T
- the type of the instance that is stored/read from the database columnpublic static interface DatabaseStorage.ColumnConvertor<T>
extends java.io.Serializable
Modifier and Type | Method and Description |
---|---|
T |
convertFromColumnValue(T value,
java.lang.Object column)
Returns an instance of object from the database column value.
|
java.lang.Object |
convertToColumnValue(T instance)
Returns a value that can be stored in a database column for the given instance.
|
boolean |
isConvertFromColumnUsed()
Returns whether the
convertFromColumnValue
method should be used when reading the object from the database. |
boolean |
isConvertToColumnUsed()
Returns whether the
convertToColumnValue
method should be used when writing the object to database. |
java.lang.Object convertToColumnValue(T instance) throws BucketStorageException
instance
- the object instance from which to create a database valueBucketStorageException
- if the value cannot be convertedboolean isConvertToColumnUsed()
convertToColumnValue
method should be used when writing the object to database.T convertFromColumnValue(T value, java.lang.Object column) throws BucketStorageException
value
, which can
be either replaced by a new value, modified by this method or left intact.value
- the instance created by previous column convertorscolumn
- the value of the column to convertBucketStorageException
- if the value cannot be convertedboolean isConvertFromColumnUsed()
convertFromColumnValue
method should be used when reading the object from the database.