Package io.datarouter.model.field
Class BaseField<T>
java.lang.Object
io.datarouter.model.field.BaseField<T>
- All Implemented Interfaces:
ByteEncodedField<T>,StringEncodedField<T>,Field<T>,Comparable<Field<T>>
- Direct Known Subclasses:
BasePrimitiveField,ByteArrayField,IntegerEnumField,KeyedListField,PrimitiveIntegerArrayField,PrimitiveLongArrayField,StringEnumField,StringField,VarIntEnumField
public abstract class BaseField<T> extends Object implements Field<T>
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBaseField.FieldColumnNameComparator -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description TfromBytesWithSeparatorButDoNotSet(byte[] bytes, int byteOffset)voidfromString(String valueAsString)Parse the result of StringEncodedField::parseStringEncodedValueButDoNotSet and apply to the current objectbyte[]getBytesWithSeparator()StringgetPrefix()StringgetPrefixedName()StringgetPreparedStatementValue()TgetValue()intgetValueHashCode()StringgetValueString()Field<T>setPrefix(String prefix)voidsetUsingReflection(Object targetFieldSet, Object fieldValue)Field<T>setValue(T value)StringtoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.datarouter.model.field.encoding.ByteEncodedField
fromBytesButDoNotSet, getBytes, numBytesWithSeparatorMethods inherited from interface io.datarouter.model.field.encoding.StringEncodedField
getStringEncodedValue, parseStringEncodedValueButDoNotSet
-
Field Details
-
Constructor Details
-
Method Details
-
getValueHashCode
public int getValueHashCode()- Specified by:
getValueHashCodein interfaceField<T>
-
toString
-
fromString
Description copied from interface:FieldParse the result of StringEncodedField::parseStringEncodedValueButDoNotSet and apply to the current object- Specified by:
fromStringin interfaceField<T>
-
getBytesWithSeparator
public byte[] getBytesWithSeparator()- Specified by:
getBytesWithSeparatorin interfaceByteEncodedField<T>
-
fromBytesWithSeparatorButDoNotSet
- Specified by:
fromBytesWithSeparatorButDoNotSetin interfaceByteEncodedField<T>
-
setUsingReflection
- Specified by:
setUsingReflectionin interfaceField<T>
-
getPrefixedName
- Specified by:
getPrefixedNamein interfaceField<T>
-
getPrefix
-
setPrefix
-
setValue
-
getValue
-
getValueString
- Specified by:
getValueStringin interfaceField<T>- Returns:
- a human-readable string for use in toString() methods. Should not be used for persistence.
-
getPreparedStatementValue
- Specified by:
getPreparedStatementValuein interfaceField<T>
-