Example usage for com.google.common.base CaseFormat UPPER_UNDERSCORE

List of usage examples for com.google.common.base CaseFormat UPPER_UNDERSCORE

Introduction

In this page you can find the example usage for com.google.common.base CaseFormat UPPER_UNDERSCORE.

Prototype

CaseFormat UPPER_UNDERSCORE

To view the source code for com.google.common.base CaseFormat UPPER_UNDERSCORE.

Click Source Link

Document

Java and C++ constant naming convention, e.g., "UPPER_UNDERSCORE".

Usage

From source file:desi.juan.internal.util.MethodGeneratorUtils.java

public static String uriToCammelCase(String uri) {
    uri = uri.replace("{", "/").replace("}", "/");
    StringBuilder result = new StringBuilder();
    for (String word : StringUtils.split(uri, "/")) {
        if (word.contains("_")) {
            word = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, word);
        }/*  w w  w .  j  ava2 s  . c  om*/
        result.append(StringUtils.capitalize(word));
    }
    return StringUtils.uncapitalize(result.toString());
}

From source file:org.gaul.s3proxy.AuthenticationType.java

static AuthenticationType fromString(String string) {
    return AuthenticationType.valueOf(CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER_UNDERSCORE, string));
}

From source file:com.opengamma.strata.product.etd.EtdType.java

/**
 * Obtains an instance from the specified unique name.
 * //ww  w  .  ja  v a2 s.c  o m
 * @param uniqueName  the unique name
 * @return the type
 * @throws IllegalArgumentException if the name is not known
 */
@FromString
public static EtdType of(String uniqueName) {
    ArgChecker.notNull(uniqueName, "uniqueName");
    return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, uniqueName));
}

From source file:com.sebrichard.mfgen.MetaFieldUtil.java

public static String generateMetaFieldName(@NotNull String field) {
    return PREFIX + CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, field);
}

From source file:org.jclouds.b2.domain.Action.java

public static Action fromValue(String symbol) {
    return Action.valueOf(CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, symbol));
}

From source file:com.opengamma.strata.market.model.MoneynessType.java

/**
 * Obtains an instance from the specified unique name.
 * /*from  w w w.  ja  va 2 s  .  com*/
 * @param uniqueName  the unique name
 * @return the type
 * @throws IllegalArgumentException if the name is not known
 */
@FromString
public static MoneynessType of(String uniqueName) {
    ArgChecker.notNull(uniqueName, "uniqueName");
    return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, uniqueName));
}

From source file:org.jclouds.glacier.domain.JobStatus.java

public static JobStatus fromString(String symbol) {
    return JobStatus.valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, symbol));
}

From source file:org.jclouds.b2.domain.BucketType.java

public static BucketType fromValue(String symbol) {
    return BucketType.valueOf(CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, symbol));
}

From source file:com.opengamma.strata.product.option.BarrierType.java

/**
 * Obtains an instance from the specified unique name.
 * //from   www  .  j a v a 2 s . c o  m
 * @param uniqueName  the unique name
 * @return the type
 * @throws IllegalArgumentException if the name is not known
 */
@FromString
public static BarrierType of(String uniqueName) {
    ArgChecker.notNull(uniqueName, "uniqueName");
    return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, uniqueName));
}

From source file:com.opengamma.strata.product.credit.ReferenceInformationType.java

/**
 * Obtains the type from a unique name./*from   w ww. ja  v  a2s  . c o m*/
 * 
 * @param uniqueName  the unique name
 * @return the type
 * @throws IllegalArgumentException if the name is not known
 */
@FromString
public static ReferenceInformationType of(String uniqueName) {
    ArgChecker.notNull(uniqueName, "uniqueName");
    return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, uniqueName));
}