Class BaseEnumerateDomainType<E>
- java.lang.Object
-
- org.openbravo.base.model.domaintype.BaseDomainType
-
- org.openbravo.base.model.domaintype.BasePrimitiveDomainType
-
- org.openbravo.base.model.domaintype.BaseEnumerateDomainType<E>
-
- All Implemented Interfaces:
DomainType
,EnumerateDomainType
,PrimitiveDomainType
- Direct Known Subclasses:
StringEnumerateDomainType
public abstract class BaseEnumerateDomainType<E> extends BasePrimitiveDomainType implements EnumerateDomainType
The type of a column which can only have a value from a pre-defined set.- Author:
- mtaal
-
-
Field Summary
-
Fields inherited from interface org.openbravo.base.model.domaintype.PrimitiveDomainType
EMPTY_STRING
-
-
Constructor Summary
Constructors Constructor Description BaseEnumerateDomainType()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEnumerateValue(E enumerateValue)
void
checkIsValidValue(Property property, Object value)
Checks if a certain value is valid according to the type of the reference.Set<E>
getEnumerateValues()
The set of enumerate values in case this reference is an Enumerate.Class<?>
getPrimitiveType()
The primitive type class (for example java.lang.Long) if this is a primitive type.-
Methods inherited from class org.openbravo.base.model.domaintype.BasePrimitiveDomainType
convertToString, createFromString, getFormatId, getHibernateType
-
Methods inherited from class org.openbravo.base.model.domaintype.BaseDomainType
checkObjectIsValid, getClasses, getModelProvider, getReference, initialize, setModelProvider, setReference
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openbravo.base.model.domaintype.DomainType
checkObjectIsValid, getModelProvider, getReference, initialize, setModelProvider, setReference
-
Methods inherited from interface org.openbravo.base.model.domaintype.PrimitiveDomainType
convertToString, createFromString, getFormatId, getHibernateType, getXMLSchemaType
-
-
-
-
Method Detail
-
getEnumerateValues
public Set<E> getEnumerateValues()
Description copied from interface:EnumerateDomainType
The set of enumerate values in case this reference is an Enumerate.- Specified by:
getEnumerateValues
in interfaceEnumerateDomainType
- Returns:
- the set of enumerate values
-
addEnumerateValue
public void addEnumerateValue(E enumerateValue)
-
getPrimitiveType
public Class<?> getPrimitiveType()
Description copied from interface:PrimitiveDomainType
The primitive type class (for example java.lang.Long) if this is a primitive type.- Specified by:
getPrimitiveType
in interfacePrimitiveDomainType
- Returns:
- class of
Object
.
-
checkIsValidValue
public void checkIsValidValue(Property property, Object value) throws ValidationException
Description copied from interface:DomainType
Checks if a certain value is valid according to the type of the reference.- Specified by:
checkIsValidValue
in interfaceDomainType
- Overrides:
checkIsValidValue
in classBasePrimitiveDomainType
- Parameters:
property
- the property which has this valuevalue
- the value- Throws:
ValidationException
-
-