com.konakart.app
Class Option

java.lang.Object
  extended by com.konakart.app.Option
All Implemented Interfaces:
OptionIf

public class Option
extends java.lang.Object
implements OptionIf

A product contains an array of these option objects. An option is used to configure a product and may change the price of a product. i.e. The amount of memory or CPU specification for a personal computer.


Field Summary
static int TYPE_SIMPLE
          Constant to define the Option type
static int TYPE_VARIABLE_QUANTITY
          Constant to define the Option type.
 
Constructor Summary
Option()
          Constructor
Option(com.workingdogs.village.Record vr, org.apache.torque.util.Criteria c)
          Instantiates the attributes of the Option object from a Record object
 
Method Summary
 java.lang.String getAttrCustom1()
          Custom field that can take a unique value whenever the option is connected to a product.
 java.lang.String getAttrCustom2()
          Custom field that can take a unique value whenever the option is connected to a product.
 int getAttrId()
          The id of the record in the products_attributes table.
 int getId()
          The id of the record in the products_options table.
 java.lang.String getName()
          The name of the option.
 java.lang.String getOptionCustom1()
          Custom field, the value of which is defined when the option is created.
 java.lang.String getOptionCustom2()
          Custom field, the value of which is defined when the option is created.
 java.lang.String getOptionValCustom1()
          Custom field, the value of which is defined when the option value is created.
 java.lang.String getOptionValCustom2()
          Custom field, the value of which is defined when the option value is created.
 java.math.BigDecimal getPrice0()
           
 java.math.BigDecimal getPrice1()
           
 java.math.BigDecimal getPrice2()
           
 java.math.BigDecimal getPrice3()
           
 java.math.BigDecimal getPriceExTax()
           
 java.math.BigDecimal getPriceIncTax()
           
 int getQuantity()
          Only applicable in the case where the option is of type TYPE_VARIABLE_QUANTITY.
 int getType()
          The type of option.
 java.lang.String getValue()
          The value of the option.
 int getValueId()
          The id of the record in the products_options_values table.
 void setAttrCustom1(java.lang.String attrCustom1)
          Custom field that can take a unique value whenever the option is connected to a product.
 void setAttrCustom2(java.lang.String attrCustom2)
          Custom field that can take a unique value whenever the option is connected to a product.
 void setAttrId(int attrId)
          The id of the record in the products_attributes table.
 void setId(int id)
          The id of the record in the products_options table.
 void setName(java.lang.String name)
          The name of the option.
 void setOptionCustom1(java.lang.String optionCustom1)
          Custom field, the value of which is defined when the option is created.
 void setOptionCustom2(java.lang.String optionCustom2)
          Custom field, the value of which is defined when the option is created.
 void setOptionValCustom1(java.lang.String optionValCustom1)
          Custom field, the value of which is defined when the option value is created.
 void setOptionValCustom2(java.lang.String optionValCustom2)
          Custom field, the value of which is defined when the option value is created.
 void setPrice0(java.math.BigDecimal price0)
           
 void setPrice1(java.math.BigDecimal price1)
           
 void setPrice2(java.math.BigDecimal price2)
           
 void setPrice3(java.math.BigDecimal price3)
           
 void setPriceExTax(java.math.BigDecimal priceExTax)
           
 void setPriceIncTax(java.math.BigDecimal priceIncTax)
           
 void setQuantity(int quantity)
          Only applicable in the case where the option is of type TYPE_VARIABLE_QUANTITY.
 void setType(int type)
          The type of option.
 void setValue(java.lang.String value)
          The value of the option.
 void setValueId(int valueId)
          The id of the record in the products_options_values table.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_SIMPLE

public static final int TYPE_SIMPLE
Constant to define the Option type

See Also:
Constant Field Values

TYPE_VARIABLE_QUANTITY

public static final int TYPE_VARIABLE_QUANTITY
Constant to define the Option type. In this case a quantity may be defined for the option. (i.e. Number of megabytes)

See Also:
Constant Field Values
Constructor Detail

Option

public Option()
Constructor


Option

public Option(com.workingdogs.village.Record vr,
              org.apache.torque.util.Criteria c)
       throws com.workingdogs.village.DataSetException
Instantiates the attributes of the Option object from a Record object

Parameters:
vr - Record containing data
c - Criteria containing column names
Throws:
com.workingdogs.village.DataSetException
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
Returns a string containing the attributes of the Option object.

getName

public java.lang.String getName()
Description copied from interface: OptionIf
The name of the option. e.g color or size.

Specified by:
getName in interface OptionIf
Returns:
Returns the name.

setName

public void setName(java.lang.String name)
Description copied from interface: OptionIf
The name of the option. e.g color or size.

Specified by:
setName in interface OptionIf
Parameters:
name - The name to set.

getValue

public java.lang.String getValue()
Description copied from interface: OptionIf
The value of the option. e.g red, blue or small, large.

Specified by:
getValue in interface OptionIf
Returns:
Returns the value.

setValue

public void setValue(java.lang.String value)
Description copied from interface: OptionIf
The value of the option. e.g red, blue or small, large.

Specified by:
setValue in interface OptionIf
Parameters:
value - The value to set.

getValueId

public int getValueId()
Description copied from interface: OptionIf
The id of the record in the products_options_values table.

Specified by:
getValueId in interface OptionIf
Returns:
Returns the valueId.

setValueId

public void setValueId(int valueId)
Description copied from interface: OptionIf
The id of the record in the products_options_values table.

Specified by:
setValueId in interface OptionIf
Parameters:
valueId - The valueId to set.

getId

public int getId()
Description copied from interface: OptionIf
The id of the record in the products_options table.

Specified by:
getId in interface OptionIf
Returns:
Returns the id.

setId

public void setId(int id)
Description copied from interface: OptionIf
The id of the record in the products_options table.

Specified by:
setId in interface OptionIf
Parameters:
id - The id to set.

getPriceExTax

public java.math.BigDecimal getPriceExTax()
Specified by:
getPriceExTax in interface OptionIf
Returns:
Returns the priceExTax.

setPriceExTax

public void setPriceExTax(java.math.BigDecimal priceExTax)
Specified by:
setPriceExTax in interface OptionIf
Parameters:
priceExTax - The priceExTax to set.

getPriceIncTax

public java.math.BigDecimal getPriceIncTax()
Specified by:
getPriceIncTax in interface OptionIf
Returns:
Returns the priceIncTax.

setPriceIncTax

public void setPriceIncTax(java.math.BigDecimal priceIncTax)
Specified by:
setPriceIncTax in interface OptionIf
Parameters:
priceIncTax - The priceIncTax to set.

getPrice0

public java.math.BigDecimal getPrice0()
Specified by:
getPrice0 in interface OptionIf
Returns:
Returns the price0.

setPrice0

public void setPrice0(java.math.BigDecimal price0)
Specified by:
setPrice0 in interface OptionIf
Parameters:
price0 - The price0 to set.

getPrice1

public java.math.BigDecimal getPrice1()
Specified by:
getPrice1 in interface OptionIf
Returns:
Returns the price1.

setPrice1

public void setPrice1(java.math.BigDecimal price1)
Specified by:
setPrice1 in interface OptionIf
Parameters:
price1 - The price1 to set.

getPrice2

public java.math.BigDecimal getPrice2()
Specified by:
getPrice2 in interface OptionIf
Returns:
Returns the price2.

setPrice2

public void setPrice2(java.math.BigDecimal price2)
Specified by:
setPrice2 in interface OptionIf
Parameters:
price2 - The price2 to set.

getPrice3

public java.math.BigDecimal getPrice3()
Specified by:
getPrice3 in interface OptionIf
Returns:
Returns the price3.

setPrice3

public void setPrice3(java.math.BigDecimal price3)
Specified by:
setPrice3 in interface OptionIf
Parameters:
price3 - The price3 to set.

getAttrId

public int getAttrId()
Description copied from interface: OptionIf
The id of the record in the products_attributes table.

Specified by:
getAttrId in interface OptionIf
Returns:
the attrId

setAttrId

public void setAttrId(int attrId)
Description copied from interface: OptionIf
The id of the record in the products_attributes table.

Specified by:
setAttrId in interface OptionIf
Parameters:
attrId - the attrId to set

getAttrCustom1

public java.lang.String getAttrCustom1()
Custom field that can take a unique value whenever the option is connected to a product.

Specified by:
getAttrCustom1 in interface OptionIf
Returns:
the attrCustom1

setAttrCustom1

public void setAttrCustom1(java.lang.String attrCustom1)
Custom field that can take a unique value whenever the option is connected to a product.

Specified by:
setAttrCustom1 in interface OptionIf
Parameters:
attrCustom1 - the attrCustom1 to set

getAttrCustom2

public java.lang.String getAttrCustom2()
Custom field that can take a unique value whenever the option is connected to a product.

Specified by:
getAttrCustom2 in interface OptionIf
Returns:
the attrCustom2

setAttrCustom2

public void setAttrCustom2(java.lang.String attrCustom2)
Custom field that can take a unique value whenever the option is connected to a product.

Specified by:
setAttrCustom2 in interface OptionIf
Parameters:
attrCustom2 - the attrCustom2 to set

getOptionCustom1

public java.lang.String getOptionCustom1()
Custom field, the value of which is defined when the option is created.

Specified by:
getOptionCustom1 in interface OptionIf
Returns:
the optionCustom1

setOptionCustom1

public void setOptionCustom1(java.lang.String optionCustom1)
Custom field, the value of which is defined when the option is created.

Specified by:
setOptionCustom1 in interface OptionIf
Parameters:
optionCustom1 - the optionCustom1 to set

getOptionCustom2

public java.lang.String getOptionCustom2()
Custom field, the value of which is defined when the option is created.

Specified by:
getOptionCustom2 in interface OptionIf
Returns:
the optionCustom2

setOptionCustom2

public void setOptionCustom2(java.lang.String optionCustom2)
Custom field, the value of which is defined when the option is created.

Specified by:
setOptionCustom2 in interface OptionIf
Parameters:
optionCustom2 - the optionCustom2 to set

getOptionValCustom1

public java.lang.String getOptionValCustom1()
Custom field, the value of which is defined when the option value is created.

Specified by:
getOptionValCustom1 in interface OptionIf
Returns:
the optionValCustom1

setOptionValCustom1

public void setOptionValCustom1(java.lang.String optionValCustom1)
Custom field, the value of which is defined when the option value is created.

Specified by:
setOptionValCustom1 in interface OptionIf
Parameters:
optionValCustom1 - the optionValCustom1 to set

getOptionValCustom2

public java.lang.String getOptionValCustom2()
Custom field, the value of which is defined when the option value is created.

Specified by:
getOptionValCustom2 in interface OptionIf
Returns:
the optionValCustom2

setOptionValCustom2

public void setOptionValCustom2(java.lang.String optionValCustom2)
Custom field, the value of which is defined when the option value is created.

Specified by:
setOptionValCustom2 in interface OptionIf
Parameters:
optionValCustom2 - the optionValCustom2 to set

getType

public int getType()
The type of option. Valid types are

Specified by:
getType in interface OptionIf
Returns:
the type

setType

public void setType(int type)
The type of option. Valid types are

Specified by:
setType in interface OptionIf
Parameters:
type - the type to set

getQuantity

public int getQuantity()
Only applicable in the case where the option is of type TYPE_VARIABLE_QUANTITY. In this case a quantity may be defined for the option which will be multiplied by the unit price in order to calculate the total option price.

Specified by:
getQuantity in interface OptionIf
Returns:
the quantity

setQuantity

public void setQuantity(int quantity)
Only applicable in the case where the option is of type TYPE_VARIABLE_QUANTITY. In this case a quantity may be defined for the option which will be multiplied by the unit price in order to calculate the total option price.

Specified by:
setQuantity in interface OptionIf
Parameters:
quantity - the quantity to set


Copyright © 2011 DS Data Systems UK Ltd.