org.jclouds.softlayer.compute.functions
Class ProductItemToImage
java.lang.Object
org.jclouds.softlayer.compute.functions.ProductItemToImage
- All Implemented Interfaces:
- com.google.common.base.Function<ProductItem,Image>
@Singleton
public class ProductItemToImage
- extends Object
- implements com.google.common.base.Function<ProductItem,Image>
- Author:
- Jason King
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.google.common.base.Function |
equals |
logger
@Named(value="jclouds.compute")
protected Logger logger
ProductItemToImage
public ProductItemToImage()
apply
public Image apply(ProductItem productItem)
- Specified by:
apply
in interface com.google.common.base.Function<ProductItem,Image>
osFamily
public static com.google.common.base.Function<ProductItem,OsFamily> osFamily()
- Parses the item description to determine the OSFamily
- Returns:
- the @see OsFamily or OsFamily.UNRECOGNIZED
osVersion
public static com.google.common.base.Function<ProductItem,String> osVersion()
- Parses the item description to determine the os version
- Returns:
- the version
- Throws:
NoSuchElementException
- if the version cannot be determined
osBits
public static com.google.common.base.Function<ProductItem,Integer> osBits()
- Parses the item description to determine the number of OS bits
Expects the number to be in parenthesis and to contain the word "bit".
The following return 64: "A (64 bit) OS", "A (64bit) OS"
- Returns:
- the number of bits
- Throws:
NoSuchElementException
- if the number of bits cannot be determined
imageId
public static com.google.common.base.Function<ProductItem,String> imageId()
- Generates an id for an Image.
- Returns:
- the generated id
Copyright © 2009-2011 jclouds. All Rights Reserved.