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 Object implements FieldKey<T>
-
Field Summary
Fields Modifier and Type Field Description protected Map<FieldKeyAttributeKey<?>,FieldKeyAttribute<?>>attributesprotected StringcolumnNameprotected TdefaultValueprotected FieldGeneratorTypefieldGeneratorTypeprotected Stringnameprotected booleannullableprotected TypevalueType -
Constructor Summary
Constructors Modifier Constructor Description protectedBaseFieldKey(String name, com.google.gson.reflect.TypeToken<T> valueType)protectedBaseFieldKey(String name, Class<T> valueType)protectedBaseFieldKey(String name, String columnName, boolean nullable, com.google.gson.reflect.TypeToken<T> valueType, FieldGeneratorType fieldGeneratorType, T defaultValue, Map<FieldKeyAttributeKey<?>,FieldKeyAttribute<?>> attributes)protectedBaseFieldKey(String name, String columnName, boolean nullable, Class<T> valueType, FieldGeneratorType fieldGeneratorType, T defaultValue, Map<FieldKeyAttributeKey<?>,FieldKeyAttribute<?>> attributes) -
Method Summary
Modifier and Type Method Description booleanequals(Object obj)<U extends FieldKeyAttribute<U>>
Optional<U>findAttribute(FieldKeyAttributeKey<U> key)TgenerateRandomValue()Map<FieldKeyAttributeKey<?>,FieldKeyAttribute<?>>getAttributes()FieldGeneratorTypegetAutoGeneratedType()StringgetColumnName()byte[]getColumnNameBytes()TgetDefaultValue()StringgetName()TypegetValueType()inthashCode()booleanisCollection()booleanisFixedLength()booleanisNullable()StringtoString()<V> Kwith(FieldKeyAttribute<V> attribute)
-
Field Details
-
name
-
columnName
-
nullable
protected final boolean nullable -
fieldGeneratorType
-
defaultValue
-
valueType
-
attributes
-
-
Constructor Details
-
BaseFieldKey
-
BaseFieldKey
-
BaseFieldKey
protected BaseFieldKey(String name, String columnName, boolean nullable, Class<T> valueType, FieldGeneratorType fieldGeneratorType, T defaultValue, Map<FieldKeyAttributeKey<?>,FieldKeyAttribute<?>> attributes) -
BaseFieldKey
protected BaseFieldKey(String name, String columnName, boolean nullable, com.google.gson.reflect.TypeToken<T> valueType, FieldGeneratorType fieldGeneratorType, T defaultValue, Map<FieldKeyAttributeKey<?>,FieldKeyAttribute<?>> attributes)
-
-
Method Details
-
toString
-
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
- Specified by:
getValueTypein interfaceFieldKey<T>
-
getName
-
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>> Optional<U> findAttribute(FieldKeyAttributeKey<U> key)- Specified by:
findAttributein interfaceFieldKey<T>
-
getAttributes
- Specified by:
getAttributesin interfaceFieldKey<T>
-
hashCode
public int hashCode() -
equals
-