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:com.google.api.codegen.LanguageUtil.java
public static String upperCamelToLowerUnderscore(String name) { name = CommonAcronyms.camelizeUpperAcronyms(name); return CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, name); }
From source file:org.robotframework.ide.eclipse.main.plugin.launch.RobotPathsNaming.java
private static String toRobotFrameworkName(final String name) { // converts suite/test name to name used by RF String resultName = name;//from ww w . j ava 2s .c om final int prefixIndex = resultName.indexOf("__"); if (prefixIndex != -1) { resultName = resultName.substring(prefixIndex + 2); } return Arrays.stream(resultName.split(" ")) .map(namePart -> CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_CAMEL, namePart)) .collect(Collectors.joining(" ")); }
From source file:org.openehr.adl.util.AdlUtils.java
public static Class<? extends CObject> getAmClass(@Nonnull String amTypeName) throws ClassNotFoundException { int genericsTypeIndex = amTypeName.indexOf('<'); String name = genericsTypeIndex == -1 ? amTypeName : amTypeName.substring(0, genericsTypeIndex); String className = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, name); //noinspection unchecked return (Class<CObject>) Class.forName(AM_PACKAGE_NAME + '.' + className); }
From source file:com.google.api.tools.framework.importers.swagger.NameConverter.java
static String schemaNameToMessageName(String schemaName) { return CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_CAMEL, sanitizeStringValue(schemaName)); }
From source file:springfox.documentation.spring.data.rest.RequestExtractionUtils.java
public static String upperCamelCaseName(String stringValue) { return CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL, stringValue); }
From source file:com.opengamma.strata.product.swap.FxResetFixingRelativeTo.java
/** * Obtains an instance from the specified unique name. * //from w w w . j av 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 FxResetFixingRelativeTo of(String uniqueName) { ArgChecker.notNull(uniqueName, "uniqueName"); return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, uniqueName)); }
From source file:org.jclouds.cloudstack.domain.GuestIPType.java
public static GuestIPType fromValue(String type) { try {//from w ww .j a v a2 s.com return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(type, "type"))); } catch (IllegalArgumentException e) { return UNRECOGNIZED; } }
From source file:com.cinchapi.common.base.CaseFormats.java
/** * Detect the {@link CaseFormat} that describes the {@code string}. * /*from w w w . j ava 2 s .c o m*/ * @param string * @return the best fit {@link CaseFormat} description */ public static CaseFormat detect(String string) { if (string.contains("-")) { return CaseFormat.LOWER_HYPHEN; } else if (string.contains("_")) { for (char c : string.toCharArray()) { if (Character.isUpperCase(c)) { return CaseFormat.UPPER_UNDERSCORE; } } return CaseFormat.LOWER_UNDERSCORE; } else if (Character.isLowerCase(string.toCharArray()[0])) { return CaseFormat.LOWER_CAMEL; } else { return CaseFormat.UPPER_CAMEL; } }
From source file:com.opengamma.strata.product.swap.PriceIndexCalculationMethod.java
/** * Obtains the type from a unique name./*from w ww .java 2s. co m*/ * * @param uniqueName the unique name * @return the type * @throws IllegalArgumentException if the name is not known */ @FromString public static PriceIndexCalculationMethod of(String uniqueName) { ArgChecker.notNull(uniqueName, "uniqueName"); return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, uniqueName)); }
From source file:com.opengamma.strata.pricer.credit.ArbitrageHandling.java
/** * Obtains an instance from the specified unique name. * //from w w w .ja va 2 s. c o m * @param uniqueName the unique name * @return the type * @throws IllegalArgumentException if the name is not known */ @FromString public static ArbitrageHandling of(String uniqueName) { ArgChecker.notNull(uniqueName, "uniqueName"); return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, uniqueName)); }