Example usage for com.amazonaws.services.ec2.model RIProductDescription fromValue

List of usage examples for com.amazonaws.services.ec2.model RIProductDescription fromValue

Introduction

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

Prototype

public static RIProductDescription fromValue(String value) 

Source Link

Document

Use this in place of valueOf.

Usage

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

License:Open Source License

/**
 * A URI-appropriate EC2 product description parser.
 * /*from  w  w  w.j av a 2  s . c  o  m*/
 * Note: The strings that RIProductDescription.fromValue accepts are not URI
 * appropriate as they have spaces, etc.
 * 
 * @param value
 * @return
 */
public static String normalizeRIProductDescription(String value) {
    if (value == null) {
        return null;
    } else if (value.startsWith(LINUX_PREFIX)) {
        return value.endsWith(AMAZONVPC_SUFFIX) ? RIProductDescription.LinuxUNIXAmazonVPC.toString()
                : RIProductDescription.LinuxUNIX.toString();
    } else if (value.startsWith(WINDOWS_PREFIX)) {
        return value.endsWith(AMAZONVPC_SUFFIX) ? RIProductDescription.WindowsAmazonVPC.toString()
                : RIProductDescription.Windows.toString();
    } else {
        return RIProductDescription.fromValue(value).toString();
    }
}