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

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

Introduction

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

Prototype

CaseFormat LOWER_CAMEL

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

Click Source Link

Document

Java variable naming convention, e.g., "lowerCamel".

Usage

From source file:org.jclouds.vcloud.domain.network.firewall.FirewallPolicy.java

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

From source file:com.google.api.tools.framework.importers.swagger.NameConverter.java

static String propertyNameToMessageName(String propertyName) {
    return CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_CAMEL, sanitizeStringValue(propertyName)) + "Type";
}

From source file:com.google.api.tools.framework.importers.swagger.aspects.utils.NameConverter.java

public static String propertyNameToMessageName(String propertyName) {
    return CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_CAMEL, sanitizeStringValue(propertyName)) + "Type";
}

From source file:org.jclouds.vcloud.domain.network.nat.rules.MappingMode.java

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

From source file:org.jclouds.vcloud.domain.network.nat.NatPolicy.java

public static NatPolicy fromValue(String policy) {
    try {// w w w.j  av a  2  s. c om
        return valueOf(CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(policy, "policy")));
    } catch (IllegalArgumentException e) {
        return UNRECOGNIZED;
    }
}

From source file:springfox.documentation.spring.data.rest.RequestExtractionUtils.java

public static String lowerCamelCaseName(String stringValue) {
    return CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL, stringValue);
}

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 a  v a 2 s  .  c o  m
    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:com.edgar.jdbc.codegen.gen.Field.java

public static Field create(Column column) {
    Field field = new Field();
    field.setHumpName(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, column.getName()));
    field.setColName(column.getName());/*  www  .  j av  a2 s. com*/
    field.setNullable(column.isNullable());
    field.setAutoInc(column.isAutoInc());
    field.setDefaultValue(column.getDefaultValue());
    field.setPrimary(column.isPrimary());
    field.setSize(column.getSize());
    //TODO
    field.setType(field.getType(column));
    return field;
}

From source file:com.cinchapi.common.base.CaseFormats.java

/**
 * Detect the {@link CaseFormat} that describes the {@code string}.
 * /*from www. j av a  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.google.api.tools.framework.importers.swagger.NameConverter.java

static String schemaNameToMessageName(String schemaName) {
    return CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_CAMEL, sanitizeStringValue(schemaName));
}