List of usage examples for com.google.common.base CaseFormat UPPER_CAMEL
CaseFormat UPPER_CAMEL
To view the source code for com.google.common.base CaseFormat UPPER_CAMEL.
Click Source Link
From source file:aeon.compiler.utils.SqliteUtils.java
/** * Converts a camelCase class or field name into an entity name with underscore-notation for use as a SQLite * table or column name./*w w w . j a v a 2 s.c om*/ * * @param name camelCase class or field name * @return Entity name in underscore-notation */ @NotNull public static String entityName(@NotNull final String name) { checkNotNull(name); return CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, name); }
From source file:org.jclouds.azure.management.domain.DeploymentSlot.java
public static DeploymentSlot fromValue(String type) { try {//from www .j a v a 2s . c o m return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(type, "type"))); } catch (IllegalArgumentException e) { return null; } }
From source file:com.opengamma.basics.BuySell.java
/** * Obtains the type from a unique name./*from w w w. ja v a2 s.c om*/ * * @param uniqueName the unique name * @return the type * @throws IllegalArgumentException if the name is not known */ @FromString public static BuySell of(String uniqueName) { ArgChecker.notNull(uniqueName, "uniqueName"); return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, uniqueName)); }
From source file:com.opengamma.strata.product.etd.EtdOptionType.java
/** * Obtains an instance from the specified unique name. * /*from w ww .jav a 2 s .c om*/ * @param uniqueName the unique name * @return the type * @throws IllegalArgumentException if the name is not known */ @FromString public static EtdOptionType of(String uniqueName) { ArgChecker.notNull(uniqueName, "uniqueName"); return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, uniqueName)); }
From source file:org.jclouds.azure.management.domain.OSType.java
public static OSType fromValue(String type) { try {/*w ww .j av a 2s .com*/ return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(type, "type"))); } catch (IllegalArgumentException e) { return UNRECOGNIZED; } }
From source file:org.jclouds.ecs.domain.LoadBalancerState.java
public static LoadBalancerState fromValue(String state) { try {//ww w. ja va2 s .c o m return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(state, "state"))); } catch (IllegalArgumentException e) { return UNRECOGNIZED; } }
From source file:org.jclouds.azure.management.domain.RoleSize.java
public static RoleSize fromValue(String type) { try {/*from w w w . j av a2s . c om*/ return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(type, "type"))); } catch (IllegalArgumentException e) { return null; } }
From source file:org.jclouds.cloudstack.domain.NetworkType.java
public static NetworkType fromValue(String type) { try {/*from w ww . ja v a 2 s .c om*/ return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(type, "type"))); } catch (IllegalArgumentException e) { return UNRECOGNIZED; } }
From source file:com.opengamma.strata.product.credit.SeniorityLevel.java
/** * Obtains the type from a unique name./*from w w w .j a v a 2s.c o m*/ * * @param uniqueName the unique name * @return the type * @throws IllegalArgumentException if the name is not known */ @FromString public static SeniorityLevel of(String uniqueName) { ArgChecker.notNull(uniqueName, "uniqueName"); String str = CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, uniqueName); if (str.endsWith("1") || str.endsWith("2")) { return valueOf(str.substring(0, str.length() - 1) + "_" + str.substring(str.length() - 1)); } return valueOf(str); }
From source file:org.jclouds.azure.storage.blob.domain.BlobType.java
public static BlobType fromValue(String type) { try {/*from w w w. j av a2 s.c om*/ return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(type, "type"))); } catch (IllegalArgumentException e) { return UNRECOGNIZED; } }