com.konakart.app
Class ProdCustAttr

java.lang.Object
  extended by com.konakart.app.ProdCustAttr
All Implemented Interfaces:
ProdCustAttrIf

public class ProdCustAttr
extends java.lang.Object
implements ProdCustAttrIf

A Custom product attribute object stores the name and value of the attribute together with some metadata describing it.


Field Summary
static int BOOLEAN_TYPE
          The string in the Value attribute is a boolean (should contain the string true or false)
static int DATE_TYPE
          The string in the Value attribute is a Date.
static int DECIMAL_TYPE
          The string in the Value attribute is a Decimal
static int INT_TYPE
          The string in the Value attribute is an int
static int STRING_TYPE
          The string in the Value attribute is a String
 
Constructor Summary
ProdCustAttr()
          Constructor
ProdCustAttr(com.workingdogs.village.Record vr, org.apache.torque.util.Criteria c)
          Instantiates the attributes of the ProdAttrDesc object from a Record object
 
Method Summary
 java.lang.String getCustom1()
           
 java.lang.String getCustom2()
           
 java.lang.String getCustom3()
           
 int getFacetNumber()
          Defines the facet field the attribute is mapped to in SOLR
 int getId()
           
 java.lang.String getMsgCatKey()
          The key used for the message catalog to look up the name to display in the store-front
 java.lang.String getName()
          The attribute name
 java.lang.String getTemplate()
          A template that can be used to format the stored data.
 int getType()
          The type of attribute.
 java.lang.String getValue()
          The value of the attribute
 java.math.BigDecimal kkGetValueAsBigDecimal()
          Utility method to return a BigDecimal.
 boolean kkGetValueAsBoolean()
          Utility method to return a boolean.
 java.util.Date kkGetValueAsDate()
          Utility method to return a Date.
 int kkGetValueAsInt()
          Utility method to return an int.
 java.lang.String kkGetValueAsString()
          Utility method to return a String.
 void kkSetValueAsBigDecimal(java.math.BigDecimal value)
          Utility method to set the tag value as a BigDecimal.
 void kkSetValueAsBoolean(boolean value)
          Utility method to set the tag value as a boolean.
 void kkSetValueAsDate(java.util.Date value)
          Utility method to set the tag value as a Date.
 void kkSetValueAsInt(int value)
          Utility method to set the tag value as an int.
 void kkSetValueAsString(java.lang.String value)
          Utility method to set the tag value as a String.
 void setCustom1(java.lang.String custom1)
           
 void setCustom2(java.lang.String custom2)
           
 void setCustom3(java.lang.String custom3)
           
 void setFacetNumber(int facetNumber)
          Defines the facet field the attribute is mapped to in SOLR
 void setId(int id)
           
 void setMsgCatKey(java.lang.String msgCatKey)
          The key used for the message catalog to look up the name to display in the store-front
 void setName(java.lang.String name)
          The attribute name
 void setTemplate(java.lang.String template)
          A template that can be used to format the stored data.
 void setType(int type)
          The type of attribute.
 void setValue(java.lang.String value)
          The value of the attribute
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STRING_TYPE

public static final int STRING_TYPE
The string in the Value attribute is a String

See Also:
Constant Field Values

INT_TYPE

public static final int INT_TYPE
The string in the Value attribute is an int

See Also:
Constant Field Values

DECIMAL_TYPE

public static final int DECIMAL_TYPE
The string in the Value attribute is a Decimal

See Also:
Constant Field Values

DATE_TYPE

public static final int DATE_TYPE
The string in the Value attribute is a Date.

See Also:
Constant Field Values

BOOLEAN_TYPE

public static final int BOOLEAN_TYPE
The string in the Value attribute is a boolean (should contain the string true or false)

See Also:
Constant Field Values
Constructor Detail

ProdCustAttr

public ProdCustAttr()
Constructor


ProdCustAttr

public ProdCustAttr(com.workingdogs.village.Record vr,
                    org.apache.torque.util.Criteria c)
             throws com.workingdogs.village.DataSetException
Instantiates the attributes of the ProdAttrDesc 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 ProdAttrDesc object.

kkGetValueAsInt

public int kkGetValueAsInt()
                    throws KKException
Utility method to return an int. An exception is thrown if the value is null or can't be parsed as an int.

Returns:
Returns an int
Throws:
KKException

kkGetValueAsDate

public java.util.Date kkGetValueAsDate()
                                throws KKException,
                                       java.text.ParseException
Utility method to return a Date. Null is returned if the value is null. An exception is thrown if the value isn't null but can't be parsed as a Date.

Returns:
Returns a date
Throws:
KKException
java.text.ParseException

kkGetValueAsString

public java.lang.String kkGetValueAsString()
Utility method to return a String. The value is returned directly with no processing.

Returns:
Returns a String

kkGetValueAsBigDecimal

public java.math.BigDecimal kkGetValueAsBigDecimal()
Utility method to return a BigDecimal. Null is returned if the value is null. An exception is thrown if the value isn't null but can't be parsed as a BigDecimal.

Returns:
Returns a BigDecimal

kkGetValueAsBoolean

public boolean kkGetValueAsBoolean()
                            throws KKException
Utility method to return a boolean. An exception is thrown if the value is null or isn't set to "true" or "false".

Returns:
Returns a boolean
Throws:
KKException

kkSetValueAsInt

public void kkSetValueAsInt(int value)
Utility method to set the tag value as an int.

Parameters:
value -

kkSetValueAsDate

public void kkSetValueAsDate(java.util.Date value)
Utility method to set the tag value as a Date.

Parameters:
value -

kkSetValueAsBoolean

public void kkSetValueAsBoolean(boolean value)
Utility method to set the tag value as a boolean.

Parameters:
value -

kkSetValueAsString

public void kkSetValueAsString(java.lang.String value)
Utility method to set the tag value as a String.

Parameters:
value -

kkSetValueAsBigDecimal

public void kkSetValueAsBigDecimal(java.math.BigDecimal value)
Utility method to set the tag value as a BigDecimal.

Parameters:
value -

getId

public int getId()
Specified by:
getId in interface ProdCustAttrIf
Returns:
the id

setId

public void setId(int id)
Specified by:
setId in interface ProdCustAttrIf
Parameters:
id - the id to set

getName

public java.lang.String getName()
Description copied from interface: ProdCustAttrIf
The attribute name

Specified by:
getName in interface ProdCustAttrIf
Returns:
the name

setName

public void setName(java.lang.String name)
Description copied from interface: ProdCustAttrIf
The attribute name

Specified by:
setName in interface ProdCustAttrIf
Parameters:
name - the name to set

getType

public int getType()
Description copied from interface: ProdCustAttrIf
The type of attribute. Valid values are:
  • STRING_TYPE=0: The tag value is a String
  • INT_TYPE=1: The tag value is an integer
  • DECIMAL_TYPE=2: The tag value is a decimal.
  • DATE_TYPE=3: The tag value is a date.
  • BOOLEAN_TYPE=4: The tag value is a boolean and so must contain the string true or false

Specified by:
getType in interface ProdCustAttrIf
Returns:
the type

setType

public void setType(int type)
Description copied from interface: ProdCustAttrIf
The type of attribute. Valid values are:
  • STRING_TYPE=0: The tag value is a String
  • INT_TYPE=1: The tag value is an integer
  • DECIMAL_TYPE=2: The tag value is a decimal.
  • DATE_TYPE=3: The tag value is a date.
  • BOOLEAN_TYPE=4: The tag value is a boolean and so must contain the string true or false

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

getCustom1

public java.lang.String getCustom1()
Specified by:
getCustom1 in interface ProdCustAttrIf
Returns:
the custom1

setCustom1

public void setCustom1(java.lang.String custom1)
Specified by:
setCustom1 in interface ProdCustAttrIf
Parameters:
custom1 - the custom1 to set

getCustom2

public java.lang.String getCustom2()
Specified by:
getCustom2 in interface ProdCustAttrIf
Returns:
the custom2

setCustom2

public void setCustom2(java.lang.String custom2)
Specified by:
setCustom2 in interface ProdCustAttrIf
Parameters:
custom2 - the custom2 to set

getCustom3

public java.lang.String getCustom3()
Specified by:
getCustom3 in interface ProdCustAttrIf
Returns:
the custom3

setCustom3

public void setCustom3(java.lang.String custom3)
Specified by:
setCustom3 in interface ProdCustAttrIf
Parameters:
custom3 - the custom3 to set

getValue

public java.lang.String getValue()
Description copied from interface: ProdCustAttrIf
The value of the attribute

Specified by:
getValue in interface ProdCustAttrIf
Returns:
the value

setValue

public void setValue(java.lang.String value)
Description copied from interface: ProdCustAttrIf
The value of the attribute

Specified by:
setValue in interface ProdCustAttrIf
Parameters:
value - the value to set

getMsgCatKey

public java.lang.String getMsgCatKey()
Description copied from interface: ProdCustAttrIf
The key used for the message catalog to look up the name to display in the store-front

Specified by:
getMsgCatKey in interface ProdCustAttrIf
Returns:
the msgCatKey

setMsgCatKey

public void setMsgCatKey(java.lang.String msgCatKey)
Description copied from interface: ProdCustAttrIf
The key used for the message catalog to look up the name to display in the store-front

Specified by:
setMsgCatKey in interface ProdCustAttrIf
Parameters:
msgCatKey - the msgCatKey to set

getTemplate

public java.lang.String getTemplate()
Description copied from interface: ProdCustAttrIf
A template that can be used to format the stored data. i.e. For a date

Specified by:
getTemplate in interface ProdCustAttrIf
Returns:
the template

setTemplate

public void setTemplate(java.lang.String template)
Description copied from interface: ProdCustAttrIf
A template that can be used to format the stored data. i.e. For a date

Specified by:
setTemplate in interface ProdCustAttrIf
Parameters:
template - the template to set

getFacetNumber

public int getFacetNumber()
Defines the facet field the attribute is mapped to in SOLR

Specified by:
getFacetNumber in interface ProdCustAttrIf
Returns:
the facetNumber

setFacetNumber

public void setFacetNumber(int facetNumber)
Defines the facet field the attribute is mapped to in SOLR

Specified by:
setFacetNumber in interface ProdCustAttrIf
Parameters:
facetNumber - the facetNumber to set


Copyright © 2011 DS Data Systems UK Ltd.