Package io.datarouter.model.field
Class BaseFieldKey<T,K extends BaseFieldKey<T,K>>
java.lang.Object
io.datarouter.model.field.BaseFieldKey<T,K>
- All Implemented Interfaces:
FieldKey<T>
- Direct Known Subclasses:
ByteArrayFieldKey,IntegerEnumFieldKey,ListFieldKey,PrimitiveFieldKey,PrimitiveIntegerArrayFieldKey,PrimitiveLongArrayFieldKey,StringEnumFieldKey,StringFieldKey,VarIntEnumFieldKey
public abstract class BaseFieldKey<T,K extends BaseFieldKey<T,K>> extends java.lang.Object implements FieldKey<T>
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<FieldKeyAttributeKey<?>,FieldKeyAttribute<?>>attributesprotected java.lang.StringcolumnNameprotected TdefaultValueprotected FieldGeneratorTypefieldGeneratorTypeprotected java.lang.Stringnameprotected booleannullableprotected java.lang.reflect.TypevalueType -
Constructor Summary
Constructors Modifier Constructor Description protectedBaseFieldKey(java.lang.String name, com.google.gson.reflect.TypeToken<T> valueType)protectedBaseFieldKey(java.lang.String name, java.lang.Class<T> valueType)protectedBaseFieldKey(java.lang.String name, java.lang.String columnName, boolean nullable, com.google.gson.reflect.TypeToken<T> valueType, FieldGeneratorType fieldGeneratorType, T defaultValue, java.util.Map<FieldKeyAttributeKey<?>,FieldKeyAttribute<?>> attributes)protectedBaseFieldKey(java.lang.String name, java.lang.String columnName, boolean nullable, java.lang.Class<T> valueType, FieldGeneratorType fieldGeneratorType, T defaultValue, java.util.Map<FieldKeyAttributeKey<?>,FieldKeyAttribute<?>> attributes) -
Method Summary
Modifier and Type Method Description booleanequals(java.lang.Object obj)<U extends FieldKeyAttribute<U>>
java.util.Optional<U>findAttribute(FieldKeyAttributeKey<U> key)TgenerateRandomValue()java.util.Map<FieldKeyAttributeKey<?>,FieldKeyAttribute<?>>getAttributes()FieldGeneratorTypegetAutoGeneratedType()java.lang.StringgetColumnName()byte[]getColumnNameBytes()TgetDefaultValue()java.lang.StringgetName()java.lang.reflect.TypegetValueType()inthashCode()booleanisCollection()booleanisFixedLength()booleanisNullable()java.lang.StringtoString()<V> Kwith(FieldKeyAttribute<V> attribute)
-
Field Details
-
name
protected final java.lang.String name -
columnName
protected final java.lang.String columnName -
nullable
protected final boolean nullable -
fieldGeneratorType
-
defaultValue
-
valueType
protected final java.lang.reflect.Type valueType -
attributes
-
-
Constructor Details
-
BaseFieldKey
-
BaseFieldKey
-
BaseFieldKey
protected BaseFieldKey(java.lang.String name, java.lang.String columnName, boolean nullable, java.lang.Class<T> valueType, FieldGeneratorType fieldGeneratorType, T defaultValue, java.util.Map<FieldKeyAttributeKey<?>,FieldKeyAttribute<?>> attributes) -
BaseFieldKey
protected BaseFieldKey(java.lang.String name, java.lang.String columnName, boolean nullable, com.google.gson.reflect.TypeToken<T> valueType, FieldGeneratorType fieldGeneratorType, T defaultValue, java.util.Map<FieldKeyAttributeKey<?>,FieldKeyAttribute<?>> attributes)
-
-
Method Details
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
isFixedLength
public boolean isFixedLength()- Specified by:
isFixedLengthin interfaceFieldKey<T>
-
isCollection
public boolean isCollection()- Specified by:
isCollectionin interfaceFieldKey<T>
-
getColumnNameBytes
public byte[] getColumnNameBytes()- Specified by:
getColumnNameBytesin interfaceFieldKey<T>
-
getDefaultValue
- Specified by:
getDefaultValuein interfaceFieldKey<T>
-
getValueType
public java.lang.reflect.Type getValueType()- Specified by:
getValueTypein interfaceFieldKey<T>
-
getName
public java.lang.String getName() -
getColumnName
public java.lang.String getColumnName()- Specified by:
getColumnNamein interfaceFieldKey<T>
-
isNullable
public boolean isNullable()- Specified by:
isNullablein interfaceFieldKey<T>
-
getAutoGeneratedType
- Specified by:
getAutoGeneratedTypein interfaceFieldKey<T>
-
generateRandomValue
- Specified by:
generateRandomValuein interfaceFieldKey<T>
-
with
-
findAttribute
public final <U extends FieldKeyAttribute<U>> java.util.Optional<U> findAttribute(FieldKeyAttributeKey<U> key)- Specified by:
findAttributein interfaceFieldKey<T>
-
getAttributes
- Specified by:
getAttributesin interfaceFieldKey<T>
-
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equalsin classjava.lang.Object
-