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

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

Introduction

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

Prototype

RIProductDescription Windows

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

Click Source Link

Usage

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

License:Open Source License

/**
 * A URI-appropriate EC2 product description parser.
 * //www.  j  av  a2s  . c om
 * 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();
    }
}