|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.aduna.gee.publication.simpleshop.Product
public class Product
| Field Summary | |
|---|---|
int |
count
|
String |
description
|
String |
id
|
WProperties |
options
|
double |
price
|
boolean |
required
|
String |
unitDescription
|
| Constructor Summary | |
|---|---|
Product(InputStream serialized)
Create a Product from its serialized version. |
|
Product(String serialized)
Create a Product from its serialized version. |
|
Product(String id,
String description,
String unitDescription,
double price,
WProperties options,
boolean required)
Create a new Product. |
|
| Method Summary | |
|---|---|
protected String |
_base64Encode(String string)
Create a Base64-encoded version of a string |
boolean |
equals(Object other)
Two products are equal when their id's are equal and their selected options are the same. |
String |
getOptionsString()
Get the selected options as a String. |
double |
getPrice()
Get the total price of the product, depending on the selected options. |
static String |
getPriceString(double price)
Get a String representing a price. |
boolean |
hasVolumeDiscount()
|
String |
toShortString()
Creates Base64-encoded a String representation of this Product that contains only the essential information for the server-side to work with. |
String |
toString()
Creates a Base64-encoded String representation of this Product that contains all information about the Product. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public String id
public String description
public String unitDescription
public double price
public int count
public boolean required
public WProperties options
| Constructor Detail |
|---|
public Product(String id,
String description,
String unitDescription,
double price,
WProperties options,
boolean required)
id - the ID of the Product in the databasedescription - a description of the ProductunitDescription - a description of the unit this Product ships inprice - the price of this Product
public Product(String serialized)
throws IOException
serialized - an String containing a Base64-encoded saved WProperties
IOExceptionProduct(java.io.InputStream)
public Product(InputStream serialized)
throws IOException
serialized - an InputStream containing a Base64-encoded saved WProperties
IOExceptionWProperties| Method Detail |
|---|
public boolean hasVolumeDiscount()
public double getPrice()
public static String getPriceString(double price)
public String getOptionsString()
public String toString()
toString in class Objectpublic String toShortString()
protected String _base64Encode(String string)
string - the String to encode
public boolean equals(Object other)
equals in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||