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

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

Introduction

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

Prototype

CaseFormat UPPER_CAMEL

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

Click Source Link

Document

Java and C++ class naming convention, e.g., "UpperCamel".

Usage

From source file:org.jclouds.glesys.domain.ServerState.java

public static ServerState fromValue(String state) {
    try {/*w  w  w. j a v  a 2 s .  com*/
        return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(state, "state")));
    } catch (IllegalArgumentException e) {
        return UNRECOGNIZED;
    }
}

From source file:org.jclouds.aws.cloudwatch.domain.StandardUnit.java

public static StandardUnit fromValue(String state) {
    try {//from  www .j  a v  a  2s  .com
        return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE,
                checkNotNull(state, "state").replace("/", "_PER_")));
    } catch (IllegalArgumentException e) {
        return UNRECOGNIZED;
    }
}

From source file:com.opengamma.strata.pricer.CompoundedRateType.java

/**
 * Obtains an instance from the specified unique name.
 * /*from   w  ww .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 CompoundedRateType of(String uniqueName) {
    ArgChecker.notNull(uniqueName, "uniqueName");
    return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, uniqueName));
}

From source file:org.springframework.data.cassandra.util.CassandraNamingUtils.java

/**
 * Obtains the table name to use for the provided class.
  * Converts upper-camel org.springframework.data.cassandra.entity name to lower-underscore format.
 * /*  w  ww .j av  a  2 s  .c  o  m*/
 * @param entityClass The class to determine the preferred table name for
 * @return The preferred collection name
 */
public static String guessTableName(Class<?> entityClass) {
    return CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, entityClass.getSimpleName());
}

From source file:org.jclouds.cloudstack.domain.NetworkOfferingAvailabilityType.java

public static NetworkOfferingAvailabilityType fromValue(String type) {
    try {//from   w  ww .  j av a  2  s  . c  o m
        return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(type, "type")));
    } catch (IllegalArgumentException e) {
        return UNRECOGNIZED;
    }
}

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

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

From source file:com.opengamma.strata.source.SearchMatchStatus.java

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

From source file:org.jclouds.gogrid.domain.ObjectType.java

public static ObjectType fromValue(String type) {
    if ("StorageDNS".equals(type))
        return STORAGE_DNS;
    try {/*from   w  w  w  .  j a v  a  2  s.  co  m*/
        return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(type, "type")));
    } catch (IllegalArgumentException e) {
        return UNRECOGNIZED;
    }
}

From source file:com.google.api.codegen.LanguageUtil.java

public static String upperCamelToLowerCamel(String name) {
    name = CommonAcronyms.camelizeUpperAcronyms(name);
    return CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL, name);
}

From source file:org.jclouds.cloudwatch.domain.Statistics.java

public static Statistics fromValue(String value) {
    try {/*from  www.  j  a  v  a2 s . c om*/
        return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(value, "value")));

    } catch (IllegalArgumentException e) {
        return UNRECOGNIZED;
    }
}