Package io.datarouter.model.field
Interface Field<T>
- All Superinterfaces:
ByteEncodedField<T>,Comparable<Field<T>>,StringEncodedField<T>
- All Known Implementing Classes:
BaseField,BaseListField,BasePrimitiveField,BooleanArrayField,BooleanField,ByteArrayField,DateField,DelimitedStringArrayField,DoubleArrayField,DoubleField,FloatField,InstantField,IntegerArrayField,IntegerEnumField,IntegerField,KeyedListField,LocalDateField,LocalDateTimeField,LongDateField,LongField,PrimitiveIntegerArrayField,PrimitiveLongArrayField,ShortField,SignedByteField,StringEnumField,StringField,UInt15Field,UInt31Field,UInt63ArrayField,UInt63Field,UInt7ArrayField,UInt7Field,VarIntEnumField,VarIntField
public interface Field<T> extends Comparable<Field<T>>, StringEncodedField<T>, ByteEncodedField<T>
A Field consists of an immutable FieldKey and a value object. It is mainly a wrapper object to carry the key/value
from a Databean to the database.
During normal operation, many Field objects will be allocated with very short lifespans. They are allocated for
PrimaryKey fields when calling equals() and compareTo() on PrimaryKeys or Databeans. They're also allocated every
time a Databean is saved.
-
Method Summary
Modifier and Type Method Description voidfromString(String string)Parse the result of StringEncodedField::parseStringEncodedValueButDoNotSet and apply to the current objectFieldKey<T>getKey()StringgetPrefix()StringgetPrefixedName()StringgetPreparedStatementValue()TgetValue()intgetValueHashCode()StringgetValueString()Field<T>setPrefix(String prefix)voidsetUsingReflection(Object targetFieldSet, Object value)Field<T>setValue(T value)Methods inherited from interface io.datarouter.model.field.encoding.ByteEncodedField
fromBytesButDoNotSet, fromBytesWithSeparatorButDoNotSet, getBytes, getBytesWithSeparator, numBytesWithSeparatorMethods inherited from interface io.datarouter.model.field.encoding.StringEncodedField
getStringEncodedValue, parseStringEncodedValueButDoNotSet
-
Method Details
-
getKey
-
getPrefix
String getPrefix() -
getPrefixedName
String getPrefixedName() -
setPrefix
-
setValue
-
getValue
T getValue() -
setUsingReflection
-
getValueHashCode
int getValueHashCode() -
getValueString
String getValueString()- Returns:
- a human-readable string for use in toString() methods. Should not be used for persistence.
-
fromString
Parse the result of StringEncodedField::parseStringEncodedValueButDoNotSet and apply to the current object -
getPreparedStatementValue
String getPreparedStatementValue()
-