com.konakart.app
Class CustomerTag

java.lang.Object
  extended by com.konakart.app.CustomerTag
All Implemented Interfaces:
CustomerTagIf

public class CustomerTag
extends java.lang.Object
implements CustomerTagIf

A customer tag is used to save customer related information used mainly for marketing purposes.


Field Summary
static int AGE_TYPE
          The string in the Value attribute is a Date.
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 represents a Date.
static int DECIMAL_TYPE
          The string in the Value attribute is a Decimal
static java.lang.String DELIM
          Used as the delimiter when storing multiple integers
static int INT_TYPE
          The string in the Value attribute is an int
static int MULTI_INT_TYPE
          The string in the Value attribute consists of multiple integers separated by a delimiter.
static int STRING_TYPE
          The string in the Value attribute is a String
 
Constructor Summary
CustomerTag()
          Constructor
CustomerTag(com.workingdogs.village.Record vr, org.apache.torque.util.Criteria c)
          Instantiates the attributes of the Tag object from a Record object
 
Method Summary
 java.lang.String getCustom1()
           
 java.lang.String getCustom2()
           
 java.lang.String getCustom3()
           
 java.lang.String getCustom4()
           
 java.lang.String getCustom5()
           
 int getCustomerId()
           
 java.util.Calendar getDateAdded()
          The last time the value of the tag (for a customer) was modified
 java.lang.String getDescription()
          Description used in expression builder.
 int getId()
           
 int getMaxInts()
          When the tag value is of type MULTI_INT_TYPE, this attribute specifies the maximum number of integers allowed.
 java.lang.String getName()
          The tag name, normally in caps.
 int getType()
          The type of tag.
 java.lang.String getValidation()
          A regular expression validation string used when a new tag is inserted.
 java.lang.String getValue()
          The value of the tag for a customer.
 java.math.BigDecimal getValueAsBigDecimal()
          Utility method to return a BigDecimal.
 boolean getValueAsBoolean()
          Utility method to return a boolean.
 java.util.Date getValueAsDate()
          Utility method to return a Date.
 int getValueAsInt()
          Utility method to return an int.
 int[] getValueAsIntArray()
          Utility method to return an array of integers.
 java.lang.String getValueAsString()
          Utility method to return a String.
 boolean isValueExists()
           
 void setCustom1(java.lang.String custom1)
           
 void setCustom2(java.lang.String custom2)
           
 void setCustom3(java.lang.String custom3)
           
 void setCustom4(java.lang.String custom4)
           
 void setCustom5(java.lang.String custom5)
           
 void setCustomerId(int customerId)
           
 void setDateAdded(java.util.Calendar dateAdded)
          The last time the value of the tag (for a customer) was modified
 void setDescription(java.lang.String description)
          Description used in expression builder.
 void setId(int id)
           
 void setMaxInts(int maxInts)
          When the tag value is of type MULTI_INT_TYPE, this attribute specifies the maximum number of integers allowed.
 void setName(java.lang.String name)
          The tag name, normally in caps.
 void setType(int type)
          The type of tag.
 void setValidation(java.lang.String validation)
          A regular expression validation string used when a new tag is inserted.
 void setValue(java.lang.String value)
          The value of the tag for a customer.
 void setValueAsBigDecimal(java.math.BigDecimal value)
          Utility method to set the tag value as a BigDecimal.
 void setValueAsBoolean(boolean value)
          Utility method to set the tag value as a boolean.
 void setValueAsDate(java.util.Date value)
          Utility method to set the tag value as a Date.
 void setValueAsInt(int value)
          Utility method to set the tag value as an int.
 void setValueAsIntArray(int[] value)
          Utility method to set the tag value as an array of ints.
 void setValueAsString(java.lang.String value)
          Utility method to set the tag value as a String.
 void setValueExists(boolean valueExists)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DELIM

public static final java.lang.String DELIM
Used as the delimiter when storing multiple integers

See Also:
Constant Field Values

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

MULTI_INT_TYPE

public static final int MULTI_INT_TYPE
The string in the Value attribute consists of multiple integers separated by a delimiter. The maxInts attributes determines how many integers are allowed.

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 represents 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

AGE_TYPE

public static final int AGE_TYPE
The string in the Value attribute is a Date. When creating expressions you can define the value to be greater or less than a length of time (in seconds) rather than comparing it to a specific date.

See Also:
Constant Field Values
Constructor Detail

CustomerTag

public CustomerTag()
Constructor


CustomerTag

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

getValueAsInt

public int getValueAsInt()
                  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

getValueAsIntArray

public int[] getValueAsIntArray()
Utility method to return an array of integers. An array of integers is stored in a String format with each integer separated by a delimiter. This method parses the String and returns an array of integers.

Returns:
Returns an array of integers.

getValueAsDate

public java.util.Date getValueAsDate()
                              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

getValueAsString

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

Returns:
Returns a String

getValueAsBigDecimal

public java.math.BigDecimal getValueAsBigDecimal()
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

getValueAsBoolean

public boolean getValueAsBoolean()
                          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

setValueAsInt

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

Parameters:
value -

setValueAsIntArray

public void setValueAsIntArray(int[] value)
Utility method to set the tag value as an array of ints.

Parameters:
value -

setValueAsDate

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

Parameters:
value -

setValueAsBoolean

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

Parameters:
value -

setValueAsString

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

Parameters:
value -

setValueAsBigDecimal

public void setValueAsBigDecimal(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 CustomerTagIf
Returns:
the id

setId

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

getName

public java.lang.String getName()
Description copied from interface: CustomerTagIf
The tag name, normally in caps. i.e. AGE, PRODUCTS_VIEWED, SEARCH_STRING

Specified by:
getName in interface CustomerTagIf
Returns:
the name

setName

public void setName(java.lang.String name)
Description copied from interface: CustomerTagIf
The tag name, normally in caps. i.e. AGE, PRODUCTS_VIEWED, SEARCH_STRING

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

getDescription

public java.lang.String getDescription()
Description copied from interface: CustomerTagIf
Description used in expression builder. i.e. Age of customer, Product recently viewed etc.

Specified by:
getDescription in interface CustomerTagIf
Returns:
the description

setDescription

public void setDescription(java.lang.String description)
Description copied from interface: CustomerTagIf
Description used in expression builder. i.e. Age of customer, Product recently viewed etc.

Specified by:
setDescription in interface CustomerTagIf
Parameters:
description - the description to set

getValue

public java.lang.String getValue()
Description copied from interface: CustomerTagIf
The value of the tag for a customer.

Specified by:
getValue in interface CustomerTagIf
Returns:
the value

setValue

public void setValue(java.lang.String value)
Description copied from interface: CustomerTagIf
The value of the tag for a customer.

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

getValidation

public java.lang.String getValidation()
Description copied from interface: CustomerTagIf
A regular expression validation string used when a new tag is inserted.

Specified by:
getValidation in interface CustomerTagIf
Returns:
the validation

setValidation

public void setValidation(java.lang.String validation)
Description copied from interface: CustomerTagIf
A regular expression validation string used when a new tag is inserted.

Specified by:
setValidation in interface CustomerTagIf
Parameters:
validation - the validation to set

getType

public int getType()
Description copied from interface: CustomerTagIf
The type of tag. Valid values are:
  • STRING_TYPE=0: The tag value is a String
  • INT_TYPE=1: The tag value is an integer
  • MULTI_INT_TYPE=2: The tag value contains one or more integers separated by a delimiter. The maxInts attributes determines how many integers are allowed.
  • DECIMAL_TYPE=3: The tag value is a decimal.
  • DATE_TYPE=4: The tag value is a date.
  • BOOLEAN_TYPE=5: The tag value is a boolean and so must contain the string true or false
  • AGE_TYPE=6: The tag value is a date. When creating expressions you can define the value to be greater or less than a length of time (in seconds) rather than comparing it to a specific date.

Specified by:
getType in interface CustomerTagIf
Returns:
the type

setType

public void setType(int type)
Description copied from interface: CustomerTagIf
The type of tag. Valid values are:
  • STRING_TYPE=0: The tag value is a String
  • INT_TYPE=1: The tag value is an integer
  • MULTI_INT_TYPE=2: The tag value contains one or more integers separated by a delimiter. The maxInts attributes determines how many integers are allowed.
  • DECIMAL_TYPE=3: The tag value is a decimal.
  • DATE_TYPE=4: The tag value is a date.
  • BOOLEAN_TYPE=5: The tag value is a boolean and so must contain the string true or false
  • AGE_TYPE=6: The tag value is a date. When creating expressions you can define the value to be greater or less than a length of time (in seconds) rather than comparing it to a specific date.

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

getMaxInts

public int getMaxInts()
Description copied from interface: CustomerTagIf
When the tag value is of type MULTI_INT_TYPE, this attribute specifies the maximum number of integers allowed.

Specified by:
getMaxInts in interface CustomerTagIf
Returns:
the maxInts

setMaxInts

public void setMaxInts(int maxInts)
Description copied from interface: CustomerTagIf
When the tag value is of type MULTI_INT_TYPE, this attribute specifies the maximum number of integers allowed.

Specified by:
setMaxInts in interface CustomerTagIf
Parameters:
maxInts - the maxInts to set

getCustom1

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

setCustom1

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

getCustom2

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

setCustom2

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

getCustom3

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

setCustom3

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

getCustom4

public java.lang.String getCustom4()
Specified by:
getCustom4 in interface CustomerTagIf
Returns:
the custom4

setCustom4

public void setCustom4(java.lang.String custom4)
Specified by:
setCustom4 in interface CustomerTagIf
Parameters:
custom4 - the custom4 to set

getCustom5

public java.lang.String getCustom5()
Specified by:
getCustom5 in interface CustomerTagIf
Returns:
the custom5

setCustom5

public void setCustom5(java.lang.String custom5)
Specified by:
setCustom5 in interface CustomerTagIf
Parameters:
custom5 - the custom5 to set

getCustomerId

public int getCustomerId()
Returns:
the customerId

setCustomerId

public void setCustomerId(int customerId)
Parameters:
customerId - the customerId to set

isValueExists

public boolean isValueExists()
Returns:
the valueExists

setValueExists

public void setValueExists(boolean valueExists)
Parameters:
valueExists - the valueExists to set

getDateAdded

public java.util.Calendar getDateAdded()
Description copied from interface: CustomerTagIf
The last time the value of the tag (for a customer) was modified

Specified by:
getDateAdded in interface CustomerTagIf
Returns:
the dateAdded

setDateAdded

public void setDateAdded(java.util.Calendar dateAdded)
Description copied from interface: CustomerTagIf
The last time the value of the tag (for a customer) was modified

Specified by:
setDateAdded in interface CustomerTagIf
Parameters:
dateAdded - the dateAdded to set


Copyright © 2011 DS Data Systems UK Ltd.