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.opengamma.strata.product.swaption.SettlementType.java

/**
 * Obtains an instance from the specified unique name.
 * //ww  w  . j  a  v a 2  s.co m
 * @param uniqueName  the unique name
 * @return the type
 * @throws IllegalArgumentException if the name is not known
 */
@FromString
public static SettlementType of(String uniqueName) {
    ArgChecker.notNull(uniqueName, "uniqueName");
    return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, uniqueName));
}

From source file:org.jclouds.azure.storage.blob.domain.LeaseStatus.java

public static LeaseStatus fromValue(String type) {
    try {//w ww  . j  ava  2 s  . c  o m
        return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(type, "type")));
    } catch (IllegalArgumentException e) {
        return UNRECOGNIZED;
    }
}

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

public static CliCommand getCommandExecutor(final String commandName) throws CommandException {
    final String commandCamel = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, commandName.toString());

    final Iterable<CliCommand> implementations = getAllCommands();
    for (final CliCommand implementation : implementations) {
        final String className = implementation.getClass().getSimpleName();
        if (className.equalsIgnoreCase(commandCamel)) {
            return implementation;
        }//  w  ww. ja  v a  2 s.co  m
    }
    throw new CommandException("No command class: " + commandName);
}

From source file:com.amazonaws.util.awsclientgenerator.generators.cpp.ErrorFormatter.java

public static String formatErrorConstName(String errorName) {
    String upper = CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, errorName.replaceAll("\\.", "_"));
    if (upper.endsWith("_ERROR")) {
        upper = upper.substring(0, upper.length() - "_ERROR".length());
    }/*from   w  w  w .  jav  a 2 s  .  c o m*/
    if (upper.endsWith("_EXCEPTION")) {
        upper = upper.substring(0, upper.length() - "_EXCEPTION".length());
    }
    return upper;
}

From source file:org.jclouds.orion.domain.BlobType.java

public static BlobType fromValue(String type) {
    try {/* w  w w .  ja v  a2 s. c o m*/
        return BlobType.valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE,
                Preconditions.checkNotNull(type, "type")));
    } catch (IllegalArgumentException e) {
        return UNRECOGNIZED;
    }
}

From source file:org.jclouds.dimensiondata.cloudcontrol.domain.State.java

public static State fromValue(String state) {
    try {/*from  www  .j  a va  2  s .c o m*/
        return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(state, "state")));
    } catch (IllegalArgumentException e) {
        return UNRECOGNIZED;
    }
}

From source file:com.opengamma.strata.calc.ReportingCurrencyType.java

/**
 * Obtains an instance from the specified unique name.
 * /*from  w  w  w.j ava 2 s  .co  m*/
 * @param uniqueName  the unique name
 * @return the type
 * @throws IllegalArgumentException if the name is not known
 */
@FromString
public static ReportingCurrencyType of(String uniqueName) {
    ArgChecker.notNull(uniqueName, "uniqueName");
    return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, uniqueName));
}

From source file:com.opengamma.strata.market.curve.node.CurveNodeDateType.java

/**
 * Obtains an instance from the specified unique name.
 * /*w  w  w  .  j  a  va  2s. c  om*/
 * @param uniqueName  the unique name
 * @return the type
 * @throws IllegalArgumentException if the name is not known
 */
@FromString
public static CurveNodeDateType 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.DeploymentStatus.java

public static DeploymentStatus fromValue(String type) {
    try {/*from   w  ww.j  a  v  a 2  s.co m*/
        return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(type, "type")));
    } catch (IllegalArgumentException e) {
        return null;
    }
}

From source file:com.opengamma.strata.finance.common.FutureOptionPremiumStyle.java

/**
 * Obtains the type from a unique name./* ww  w  . j  ava  2  s .co m*/
 * 
 * @param uniqueName  the unique name
 * @return the type
 * @throws IllegalArgumentException if the name is not known
 */
@FromString
public static FutureOptionPremiumStyle of(String uniqueName) {
    ArgChecker.notNull(uniqueName, "uniqueName");
    return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, uniqueName));
}