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.google.api.codegen.LanguageUtil.java

public static String lowerUnderscoreToUpperCamel(String name) {
    return CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, name);
}

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

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

From source file:com.opengamma.strata.measure.fxopt.FxVanillaOptionMethod.java

/**
 * Obtains an instance from the specified unique name.
 * //from  w  w w.jav  a2s.  c  om
 * @param uniqueName  the unique name
 * @return the type
 * @throws IllegalArgumentException if the name is not known
 */
@FromString
public static FxVanillaOptionMethod of(String uniqueName) {
    ArgChecker.notNull(uniqueName, "uniqueName");
    return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, uniqueName));
}

From source file:com.spectralogic.ds3cli.command.CliCommandFactory.java

public static String listAllCommands() {
    final StringBuilder commandHelp = new StringBuilder("Installed Commands: ");

    final FluentIterable<String> commands = FluentIterable.from(getAllCommands())
            .transform(new Function<CliCommand, String>() {
                @Nullable/*ww  w  .jav a2 s . c  om*/
                @Override
                public String apply(@Nullable final CliCommand input) {
                    return CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE,
                            input.getClass().getSimpleName());
                }
            });
    final Joiner joiner = Joiner.on(", ");
    commandHelp.append(joiner.join(commands));
    return commandHelp.toString();
}

From source file:com.opengamma.strata.market.ShiftType.java

/**
 * Obtains an instance from the specified unique name.
 * /* ww  w. ja  va2s.  co m*/
 * @param uniqueName  the unique name
 * @return the type
 * @throws IllegalArgumentException if the name is not known
 */
@FromString
public static ShiftType 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 phraseVariableName() {
    String value = str;//  w  w w. j a v  a2 s. c  om
    if (Character.isUpperCase(str.charAt(0))) {
        if (str.contains("_")) {
            value = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, str);
        } else {
            value = CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL, str);
        }
    } else {
        if (str.contains("_")) {
            value = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, str);
        }
    }
    return value;
}

From source file:com.netflix.paas.dao.astyanax.AstyanaxDao.java

private static String entityNameFromClass(Class<?> entityType) {
    return CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE,
            StringUtils.removeEnd(StringUtils.substringAfterLast(entityType.getName(), "."), "Entity"));
}

From source file:com.mysema.query.types.path.PathBuilderFactory.java

/**
 * Create a new PathBuilder instance for the given type
 * //from  ww w.j av  a 2s  . co  m
 * @param clazz
 * @return
 */
@SuppressWarnings("unchecked")
public <T> PathBuilder<T> create(Class<T> clazz) {
    PathBuilder<T> rv = (PathBuilder<T>) paths.get(clazz);
    if (rv == null) {
        rv = new PathBuilder<T>(clazz,
                CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL, clazz.getSimpleName()));
        paths.put(clazz, rv);
    }
    return rv;
}

From source file:aritzh.waywia.universe.Universe.java

public static Universe newUniverse(String name, File saveFolder, String defaultWorldName, InGameState state)
        throws IOException {
    String folderName = CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL, name);
    File root = new File(saveFolder, folderName);
    if (!root.exists() && !root.mkdirs())
        throw new IOException("Could not create folder for new universe at: " + root.getAbsolutePath());

    Set<World> worlds = new HashSet<>();
    String worldName = CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL, defaultWorldName);
    World defaultWorld = World.newWorld(worldName, root);

    BDSCompound comp = new BDSCompound("CustomData");

    Universe u = new Universe(name, root, worlds, defaultWorld, comp, state);
    u.toBDS().writeToFile(new File(root, "universe.dat"));
    return u;//  w ww . ja v a 2  s  .co m
}

From source file:clocker.docker.location.strategy.AbstractDockerPlacementStrategy.java

@Override
public String getShortName() {
    return CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_HYPHEN, getClass().getSimpleName());
}