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:com.evolveum.midpoint.repo.sql.util.MidPointPhysicalNamingStrategy.java

@Override
public Identifier toPhysicalTableName(Identifier identifier, JdbcEnvironment jdbcEnvironment) {
    String name = identifier.getText();
    if (name.startsWith("m_") || "hibernate_sequence".equals(name)) {
        return identifier;
    }/*from   w  w  w. j  a v a 2 s .c o  m*/

    name = name.substring(1);
    name = "m_" + CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, name);
    name = RUtil.fixDBSchemaObjectNameLength(name);

    Identifier i = new Identifier(name, identifier.isQuoted());

    LOGGER.trace("toPhysicalTableName {} -> {}", identifier, i);

    return i;
}

From source file:com.facebook.buck.cxx.toolchain.HeaderMode.java

HeaderMode() {
    this.flavor = InternalFlavor.of(String.format("%s-%s",
            CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_HYPHEN, getClass().getSimpleName()),
            CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_HYPHEN, toString())));
}

From source file:org.jclouds.vcloud.director.v1_5.VCloudDirectorException.java

private static String message(Error error, String from) {
    Iterable<String> words = Iterables.transform(Splitter.on('_').split(error.getMinorErrorCode()),
            new Function<String, String>() {
                @Override/*from  w  w w .  jav a2s  .c o  m*/
                public String apply(String input) {
                    return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, input);
                }
            });
    return String.format(MSG_FMT, Joiner.on(' ').join(words), error.getMajorErrorCode(), from,
            error.getMessage());
}

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

public String value() {
    return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, name()).replace("PerSecond", "/Second");
}

From source file:sklearn.Transformer.java

protected String name() {
    Class<? extends Transformer> clazz = getClass();

    String name = clazz.getSimpleName();

    return CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, name);
}

From source file:org.zanata.sync.common.model.SyncOption.java

@JsonValue
public String getValue() {
    return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, this.name());
}

From source file:org.ow2.proactive.scheduling.api.graphql.common.Types.java

public String getName() {
    return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, name());
}

From source file:com.opengamma.strata.finance.rate.swap.CompoundingMethod.java

/**
 * Obtains the type from a 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 CompoundingMethod of(String uniqueName) {
    ArgChecker.notNull(uniqueName, "uniqueName");
    return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, uniqueName));
}

From source file:com.github.ko2ic.plugin.eclipse.taggen.common.domain.valueobject.NameRuleString.java

public String phraseConstantName() {
    String value = str;/*from   w w w .j a  v  a  2 s.  c  o  m*/
    if (Character.isUpperCase(str.charAt(0))) {
        if (!str.contains("_")) {
            value = CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, str);
        }
    } else {
        if (str.contains("_")) {
            value = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.UPPER_UNDERSCORE, str);
        } else {
            value = CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, str);
        }
    }
    return value;
}

From source file:com.opengamma.strata.product.swaption.SettlementType.java

/**
 * Returns the formatted unique name of the type.
 * // ww  w.j  a  va  2 s  .c o  m
 * @return the formatted string representing the type
 */
@ToString
@Override
public String toString() {
    return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, name());
}