com.elasticpath.domain.attribute.impl
Class AbstractAttributeTypeImpl

java.lang.Object
  extended by com.elasticpath.domain.impl.AbstractEpDomainImpl
      extended by com.elasticpath.domain.attribute.impl.AbstractAttributeTypeImpl
All Implemented Interfaces:
AttributeType, EpDomain, java.io.Serializable

public abstract class AbstractAttributeTypeImpl
extends AbstractEpDomainImpl
implements java.io.Serializable, AttributeType

This is a template implementation of AttributeType. It also contains enums of various attribute types.

See Also:
Serialized Form

Field Summary
static AttributeType BOOLEAN
          The attribute type of boolean : true or false.
static int BOOLEAN_TYPE_ID
          Attribute type id for boolean.
static AbstractAttributeTypeImpl DATE
          The attribute type for a date.
static int DATE_TYPE_ID
          Attribute type id for data.
static AttributeType DATETIME
          The attribute type for a date & time.
static int DATETIME_TYPE_ID
          Attribute type id for data time.
static AttributeType DECIMAL
          The attribute type of a decimal number.
static int DECIMAL_TYPE_ID
          Attribute type id for decimal.
static AttributeType FILE
          The attribute type for uploading files to the server.
static int FILE_TYPE_ID
          Attribute type id for file.
static AttributeType IMAGE
          The attribute type for any images for display.
static int IMAGE_TYPE_ID
          Attribute type id for image.
static AttributeType INTEGER
          The attribute type of a non-decimal number.
static int INTEGER_TYPE_ID
          Attribute type id for integer.
static AttributeType LONG_TEXT
          Text long attribute type contains 2000 characters or less.
static int LONG_TEXT_TYPE_ID
          Attribute type id for long text.
static AttributeType PICKLIST
          The attribute type of a list of user-defined values such as (Small, Medium, Large).
static int PICKLIST_TYPE_ID
          Attribute type id for pick list.
static long serialVersionUID
          Serial version id.
static AbstractAttributeTypeImpl SHORT_TEXT
          Text short attribute type contains 255 characters or less.
static int SHORT_TEXT_TYPE_ID
          Attribute type id for short text.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Return true if the given object is AttributeType and has the same id.
static AttributeType[] getAttributeTypes()
          Returns an array of all available AttributeTypes.
 ElasticPath getElasticPath()
          Returns the ElasticPath singleton.
static AttributeType getInstance(int attributeTypeId)
          Get the attribute type with the given attribute type id.
abstract  java.lang.String getStringValue(AttributeValueWithType attributeValueImpl)
          Get the string value of the given attribute value instance.
 int getTypeId()
          Return the attribute type Id.
abstract  java.lang.Object getValue(AttributeValueWithType attributeValueImpl)
          Get the value object of the given attribute value instance.
 int hashCode()
          Return the hash code.
abstract  void setStringValue(AttributeValueWithType attributeValueImpl, java.lang.String stringValue)
          Set the given attribute value with the given string value.
abstract  void setValue(AttributeValueWithType attributeValueImpl, java.lang.Object value)
          Set the given value object to the given attribute value instance.
 java.lang.String toString()
          Return the attribute type name.
 
Methods inherited from class com.elasticpath.domain.impl.AbstractEpDomainImpl
setElasticPath
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.elasticpath.domain.attribute.AttributeType
getStorageType
 

Field Detail

BOOLEAN

public static final AttributeType BOOLEAN
The attribute type of boolean : true or false.


BOOLEAN_TYPE_ID

public static final int BOOLEAN_TYPE_ID
Attribute type id for boolean.

See Also:
Constant Field Values

DATE

public static final AbstractAttributeTypeImpl DATE
The attribute type for a date.


DATE_TYPE_ID

public static final int DATE_TYPE_ID
Attribute type id for data.

See Also:
Constant Field Values

DATETIME

public static final AttributeType DATETIME
The attribute type for a date & time.


DATETIME_TYPE_ID

public static final int DATETIME_TYPE_ID
Attribute type id for data time.

See Also:
Constant Field Values

DECIMAL

public static final AttributeType DECIMAL
The attribute type of a decimal number.


DECIMAL_TYPE_ID

public static final int DECIMAL_TYPE_ID
Attribute type id for decimal.

See Also:
Constant Field Values

FILE

public static final AttributeType FILE
The attribute type for uploading files to the server.


FILE_TYPE_ID

public static final int FILE_TYPE_ID
Attribute type id for file.

See Also:
Constant Field Values

IMAGE

public static final AttributeType IMAGE
The attribute type for any images for display.


IMAGE_TYPE_ID

public static final int IMAGE_TYPE_ID
Attribute type id for image.

See Also:
Constant Field Values

INTEGER

public static final AttributeType INTEGER
The attribute type of a non-decimal number.


INTEGER_TYPE_ID

public static final int INTEGER_TYPE_ID
Attribute type id for integer.

See Also:
Constant Field Values

LONG_TEXT

public static final AttributeType LONG_TEXT
Text long attribute type contains 2000 characters or less.


LONG_TEXT_TYPE_ID

public static final int LONG_TEXT_TYPE_ID
Attribute type id for long text.

See Also:
Constant Field Values

PICKLIST

public static final AttributeType PICKLIST
The attribute type of a list of user-defined values such as (Small, Medium, Large).


PICKLIST_TYPE_ID

public static final int PICKLIST_TYPE_ID
Attribute type id for pick list.

See Also:
Constant Field Values

serialVersionUID

public static final long serialVersionUID
Serial version id.

See Also:
Constant Field Values

SHORT_TEXT

public static final AbstractAttributeTypeImpl SHORT_TEXT
Text short attribute type contains 255 characters or less.


SHORT_TEXT_TYPE_ID

public static final int SHORT_TEXT_TYPE_ID
Attribute type id for short text.

See Also:
Constant Field Values
Method Detail

equals

public boolean equals(java.lang.Object obj)
Return true if the given object is AttributeType and has the same id.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to compare
Returns:
true if the given attribute type has the same id

getAttributeTypes

public static AttributeType[] getAttributeTypes()
Returns an array of all available AttributeTypes.

Returns:
an array of all available AttributeTypes.

getElasticPath

public ElasticPath getElasticPath()
Returns the ElasticPath singleton.

Specified by:
getElasticPath in interface EpDomain
Overrides:
getElasticPath in class AbstractEpDomainImpl
Returns:
the ElasticPath singleton.

getInstance

public static AttributeType getInstance(int attributeTypeId)
Get the attribute type with the given attribute type id.

Parameters:
attributeTypeId - the attribute type id
Returns:
the attribute type instance

getStringValue

public abstract java.lang.String getStringValue(AttributeValueWithType attributeValueImpl)
Get the string value of the given attribute value instance.

Specified by:
getStringValue in interface AttributeType
Parameters:
attributeValueImpl - the attribute value instance
Returns:
the string value

getTypeId

public int getTypeId()
Return the attribute type Id.

Specified by:
getTypeId in interface AttributeType
Returns:
the attribute type Id

getValue

public abstract java.lang.Object getValue(AttributeValueWithType attributeValueImpl)
Get the value object of the given attribute value instance.

Specified by:
getValue in interface AttributeType
Parameters:
attributeValueImpl - the attribute value instance
Returns:
the value object

hashCode

public int hashCode()
Return the hash code.

Overrides:
hashCode in class java.lang.Object
Returns:
the hash code

setStringValue

public abstract void setStringValue(AttributeValueWithType attributeValueImpl,
                                    java.lang.String stringValue)
                             throws EpBindException
Set the given attribute value with the given string value.

Specified by:
setStringValue in interface AttributeType
Parameters:
attributeValueImpl - the attribute value instance
stringValue - the string value to set
Throws:
EpBindException - when the string value cannot be binded to the attribute type

setValue

public abstract void setValue(AttributeValueWithType attributeValueImpl,
                              java.lang.Object value)
Set the given value object to the given attribute value instance.

Specified by:
setValue in interface AttributeType
Parameters:
attributeValueImpl - the attribute value instance
value - the value object

toString

public java.lang.String toString()
Return the attribute type name.

Specified by:
toString in interface AttributeType
Overrides:
toString in class java.lang.Object
Returns:
the attribute type name