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

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

Introduction

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

Prototype

RIProductDescription LinuxUNIXAmazonVPC

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

Click Source Link

Usage

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

License:Open Source License

/**
 * A URI-appropriate EC2 product description parser.
 * //w  ww. j ava  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();
    }
}