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

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

Introduction

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

Prototype

RIProductDescription WindowsAmazonVPC

To view the source code for com.amazonaws.services.ec2.model RIProductDescription WindowsAmazonVPC.

Click Source Link

Usage

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

License:Open Source License

/**
 * A URI-appropriate EC2 product description parser.
 * /* www. ja  v a  2s .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();
    }
}