Package com.kenshoo.pl.entity
Class UniqueKeyValue<E extends EntityType<E>>
- java.lang.Object
-
- com.kenshoo.pl.entity.UniqueKeyValue<E>
-
- All Implemented Interfaces:
FieldsValueMap<E>,Identifier<E>
- Direct Known Subclasses:
PairUniqueKeyValue,QuadrupleUniqueKeyValue,QuintupleUniqueKeyValue,SingleUniqueKeyValue,TripleUniqueKeyValue
public class UniqueKeyValue<E extends EntityType<E>> extends java.lang.Object implements Identifier<E>
Holds the value of the unique keyThe order of values MUST match the order in the UniqueKey.
The instance is supposed to be immutable. When mutable objects are added to values, they must not change after they were added.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Object[]values
-
Constructor Summary
Constructors Modifier Constructor Description protectedUniqueKeyValue(UniqueKey<E> uniqueKey, java.lang.Object[] values)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <E extends EntityType<E>>
Identifier<E>concat(Identifier<E> id1, Identifier<E> id2)<T> booleancontainsField(EntityField<E,T> field)Returnstrueis the map has a value for the given fieldstatic <E extends EntityType<E>>
UniqueKeyValue<E>empty()booleanequals(java.lang.Object o)<T> Tget(EntityField<E,T> field)Returns the value of the specified field.UniqueKey<E>getUniqueKey()inthashCode()java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.kenshoo.pl.entity.FieldsValueMap
safeGet
-
Methods inherited from interface com.kenshoo.pl.entity.Identifier
contains, getValues, isEmpty, size
-
-
-
-
Method Detail
-
empty
public static <E extends EntityType<E>> UniqueKeyValue<E> empty()
-
containsField
public <T> boolean containsField(EntityField<E,T> field)
Description copied from interface:FieldsValueMapReturnstrueis the map has a value for the given field- Specified by:
containsFieldin interfaceFieldsValueMap<E extends EntityType<E>>
-
get
public <T> T get(EntityField<E,T> field)
Description copied from interface:FieldsValueMapReturns the value of the specified field.- Specified by:
getin interfaceFieldsValueMap<E extends EntityType<E>>- Type Parameters:
T- type of the field- Parameters:
field- field to query- Returns:
- the value of the field. Can be
null.
-
getUniqueKey
public UniqueKey<E> getUniqueKey()
- Specified by:
getUniqueKeyin interfaceIdentifier<E extends EntityType<E>>
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
concat
public static <E extends EntityType<E>> Identifier<E> concat(Identifier<E> id1, Identifier<E> id2)
-
-