T
- the class of instances that are serialized into the databasepublic static class DatabaseStorage.MetaObjectTextStreamColumnConvertor<T extends MetaObject> extends DatabaseStorage.LocalAbstractObjectTextStreamColumnConvertor<T>
LocalAbstractObject
encapsulated in T
are
serialized using write
method and deserialized using LocalAbstractObject.TextStreamFactory
.
Note that this convertor can be used only to writing.Constructor and Description |
---|
DatabaseStorage.MetaObjectTextStreamColumnConvertor(java.lang.Class<? extends T> storedObjectsClass,
java.lang.String encapsulatedObjectName)
Creates a new instance of MetaObjectTextStreamColumnConvertor.
|
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.
|
convertToColumnValue, isConvertFromColumnUsed, isConvertToColumnUsed
public DatabaseStorage.MetaObjectTextStreamColumnConvertor(java.lang.Class<? extends T> storedObjectsClass, java.lang.String encapsulatedObjectName)
storedObjectsClass
- the class of instances that are serialized by this column convertorencapsulatedObjectName
- the name of the LocalAbstractObject
encapsulated in the MetaObject
public java.lang.Object convertToColumnValue(T instance) throws BucketStorageException
DatabaseStorage.ColumnConvertor
instance
- the object instance from which to create a database valueBucketStorageException
- if the value cannot be convertedpublic T convertFromColumnValue(T value, java.lang.Object column) throws BucketStorageException
DatabaseStorage.ColumnConvertor
value
, which can
be either replaced by a new value, modified by this method or left intact.convertFromColumnValue
in interface DatabaseStorage.ColumnConvertor<T extends MetaObject>
convertFromColumnValue
in class DatabaseStorage.LocalAbstractObjectTextStreamColumnConvertor<T extends MetaObject>
value
- the instance created by previous column convertorscolumn
- the value of the column to convertBucketStorageException
- if the value cannot be converted