Example usage for com.amazonaws.services.ec2.model OfferingTypeValues LightUtilization

List of usage examples for com.amazonaws.services.ec2.model OfferingTypeValues LightUtilization

Introduction

In this page you can find the example usage for com.amazonaws.services.ec2.model OfferingTypeValues LightUtilization.

Prototype

OfferingTypeValues LightUtilization

To view the source code for com.amazonaws.services.ec2.model OfferingTypeValues LightUtilization.

Click Source Link

Usage

From source file:com.kenlin.awsec2offering.App.java

License:Open Source License

/**
 * A URI-appropriate EC2 offering type parser.
 * /*from  w  w w  .j a v a 2  s.  c  o  m*/
 * Note: The strings that OfferingTypeValues.fromValue accepts are not URI
 * appropriate as they have spaces, etc.
 * 
 * @param value
 * @return
 */
public static String normalizeOfferingType(String value) {
    if (value == null) {
        return null;
    } else if (value.startsWith(HEAVY_PREFIX)) {
        return OfferingTypeValues.HeavyUtilization.toString();
    } else if (value.startsWith(MEDIUM_PREFIX)) {
        return OfferingTypeValues.MediumUtilization.toString();
    } else if (value.startsWith(LIGHT_PREFIX)) {
        return OfferingTypeValues.LightUtilization.toString();
    } else {
        return OfferingTypeValues.fromValue(value).toString();
    }
}