public class AWSDevPayProduct
extends java.lang.Object
implements java.io.Serializable, java.lang.Comparable
Constructor and Description |
---|
AWSDevPayProduct(java.lang.String productToken) |
AWSDevPayProduct(java.lang.String productToken,
java.lang.String productName) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(java.lang.Object o)
Compare two products by their names (using string comparision)
|
java.lang.String |
getProductName() |
java.lang.String |
getProductToken() |
static java.util.Vector |
load()
Loads the products listed in
Constants.DEVPAY_PRODUCTS_PROPERTIES_FILENAME |
static java.util.Vector |
load(java.io.InputStream pin)
Loads the products listed in the
Properties file
represented by the input stream. |
static java.util.Vector |
load(java.util.Properties prodProps)
Loads the products listed in the
Properties . |
java.lang.String |
toString() |
public AWSDevPayProduct(java.lang.String productToken)
public AWSDevPayProduct(java.lang.String productToken, java.lang.String productName)
public java.lang.String getProductName()
public java.lang.String getProductToken()
public java.lang.String toString()
toString
in class java.lang.Object
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public static java.util.Vector load() throws java.io.IOException
Constants.DEVPAY_PRODUCTS_PROPERTIES_FILENAME
AWSDevPayProduct
sjava.io.IOException
public static java.util.Vector load(java.io.InputStream pin) throws java.io.IOException
Properties
file
represented by the input stream.pin
- the input streamAWSDevPayProduct
sjava.io.IOException
public static java.util.Vector load(java.util.Properties prodProps)
Properties
.
Specifically, any properties ending in Constants.DEVPAY_PRODUCT_NAME_PROP_SUFFIX
(the product's name)
have that ending removed and replaced with Constants.DEVPAY_PRODUCT_NAME_PROP_SUFFIX
(to form name of the property for the product's token).
If the token exists, then a AWSDevPayProduct
is constructed
with that name and token, and then is added to the Vector. For example,
(with the current constants) "foo.name" would become "foo.token";
if both properties exist, then a product is constructed with the values of
the "foo.name" and "foo.token" properties (e.g. "Foo" and "{ProductToken}AAA...").prodProps
- the propertiesAWSDevPayProduct
s, sorted by name