Class DataType
- java.lang.Object
-
- com.hybris.cockpitng.dataaccess.facades.type.DataType
-
- Direct Known Subclasses:
CollectionDataType,MapDataType
public class DataType extends java.lang.ObjectHolds meta information about a type, especially which attributes it has.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDataType.BuilderBuilder class forDataType.static classDataType.Type
-
Field Summary
Fields Modifier and Type Field Description static DataTypeBIG_DECIMALstatic DataTypeBOOLEANstatic DataTypeBYTEstatic DataTypeCHARACTERstatic DataTypeDATEstatic DataTypeDOUBLEstatic DataTypeFLOATstatic DataTypeINTEGERstatic DataTypeLONGstatic DataTypeNULLstatic DataTypeNULL_COMPOUNDstatic DataTypeSHORTstatic DataTypeSTRING
-
Constructor Summary
Constructors Modifier Constructor Description protectedDataType(DataType.Builder builder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)java.util.Map<java.util.Locale,java.lang.String>getAllLabels()Returns all labels for this type.java.util.List<java.lang.String>getAllSuperTypes()DataAttributegetAttribute(java.lang.String qualifier)Returns theDataAttributefor the given qualifier or null, if not existing.java.util.Collection<DataAttribute>getAttributes()Returns the attributes this type provides, or an empty collection, if this type is atomic.java.lang.ClassgetClazz()Returns the corresponding javaClassfor this type.java.lang.StringgetCode()Returns the (unique) code of this type.java.lang.StringgetLabel(java.util.Locale locale)Returns the label for the given locale.java.util.List<java.lang.String>getSubtypes()Returns a set of names of all available subtypes that directly inherit from the type (1-st level subtypes).java.lang.StringgetSuperType()DataType.TypegetType()inthashCode()booleanisAbstract()booleanisAtomic()Returns true, if this Type is atomic (i.e.booleanisEnum()Returns true, if this Type is an enumerationbooleanisSearchable()booleanisSingleton()
-
-
-
Field Detail
-
NULL
public static final DataType NULL
-
NULL_COMPOUND
public static final DataType NULL_COMPOUND
-
BOOLEAN
public static final DataType BOOLEAN
-
STRING
public static final DataType STRING
-
BYTE
public static final DataType BYTE
-
CHARACTER
public static final DataType CHARACTER
-
SHORT
public static final DataType SHORT
-
INTEGER
public static final DataType INTEGER
-
LONG
public static final DataType LONG
-
FLOAT
public static final DataType FLOAT
-
DOUBLE
public static final DataType DOUBLE
-
BIG_DECIMAL
public static final DataType BIG_DECIMAL
-
DATE
public static final DataType DATE
-
-
Constructor Detail
-
DataType
protected DataType(DataType.Builder builder)
-
-
Method Detail
-
getAttributes
public java.util.Collection<DataAttribute> getAttributes()
Returns the attributes this type provides, or an empty collection, if this type is atomic.
-
getClazz
public java.lang.Class getClazz()
Returns the corresponding javaClassfor this type.
-
getCode
public java.lang.String getCode()
Returns the (unique) code of this type.
-
getAttribute
public DataAttribute getAttribute(java.lang.String qualifier)
Returns theDataAttributefor the given qualifier or null, if not existing.
-
isAtomic
public boolean isAtomic()
Returns true, if this Type is atomic (i.e. doesn't provide any attributes).
-
isEnum
public boolean isEnum()
Returns true, if this Type is an enumeration
-
getType
public DataType.Type getType()
- Returns:
- Type's family
-
getLabel
public java.lang.String getLabel(java.util.Locale locale)
Returns the label for the given locale.
-
getAllLabels
public java.util.Map<java.util.Locale,java.lang.String> getAllLabels()
Returns all labels for this type.
-
getSubtypes
public java.util.List<java.lang.String> getSubtypes()
Returns a set of names of all available subtypes that directly inherit from the type (1-st level subtypes).
-
isSearchable
public boolean isSearchable()
- Returns:
- true if the instances of the type may be found using search mechanism. For example database views may be declared as types but may not be a valid search target types.
-
getSuperType
public java.lang.String getSuperType()
- Returns:
- Code of the supertype if exists, null otherwise.
-
isAbstract
public boolean isAbstract()
- Returns:
- true if the type is abstract
-
isSingleton
public boolean isSingleton()
- Returns:
- true if the type is a singleton ie. only one instance of the type is allowed
-
getAllSuperTypes
public java.util.List<java.lang.String> getAllSuperTypes()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-