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

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

Introduction

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

Prototype

OfferingTypeValues MediumUtilization

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

Click Source Link

Usage

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

License:Open Source License

/**
 * A URI-appropriate EC2 offering type parser.
 * /* www . j a v  a2s .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();
    }
}