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

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

Introduction

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

Prototype

CaseFormat UPPER_UNDERSCORE

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

Click Source Link

Document

Java and C++ constant naming convention, e.g., "UPPER_UNDERSCORE".

Usage

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

public static Statistics fromValue(String value) {
    try {/* w w w  . j  a  v a 2s.c om*/
        return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(value, "value")));

    } catch (IllegalArgumentException e) {
        return UNRECOGNIZED;
    }
}

From source file:com.github.benmanes.caffeine.cache.Feature.java

public static String makeEnumName(String enumName) {
    return CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, enumName);
}

From source file:org.jclouds.fujitsu.fgcp.domain.VSystemStatus.java

public static VSystemStatus fromValue(String status) {
    try {//from   www . j a  v a 2s  .  c om
        return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(status, "status")));
    } catch (IllegalArgumentException e) {
        return UNRECOGNIZED;
    }
}

From source file:com.opengamma.strata.product.swap.OvernightAccrualMethod.java

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

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

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

From source file:com.opengamma.strata.product.etd.EtdSettlementType.java

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

From source file:org.jclouds.azureblob.domain.AccessTier.java

public static AccessTier fromValue(String tier) {
    return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(tier, "tier")));
}

From source file:com.opengamma.strata.pricer.credit.AccrualOnDefaultFormula.java

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

From source file:org.jclouds.fujitsu.fgcp.domain.VDiskStatus.java

public static VDiskStatus fromValue(String status) {
    try {/*ww w  . j  av a2 s.c o m*/
        return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(status, "status")));
    } catch (IllegalArgumentException e) {
        return UNRECOGNIZED;
    }
}

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

public static HistoryItemType fromValue(String value) {
    try {/*from  w w  w.j a v  a  2s.com*/
        return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(value, "value")));
    } catch (IllegalArgumentException e) {
        return UNRECOGNIZED;
    }
}