public interface ConversionHandler
| Modifier and Type | Method and Description |
|---|---|
List |
createList(DriveElementArray array,
Class clazz,
Object parent)
Creates a new list with the given class
|
void |
registerClasses(Class<?>... classes)
Register classes used for conversion.
|
void |
registerSerializers(CustomSerializer... serializers)
Register serializers used to convert complex endpoints to database values.
|
void |
setService(DriveService service)
Sets the service the reader is used by.
|
<T> T |
transform(DriveObject statisticsObject,
Class<T> clazz)
Transforms a stats object into a classes object.
|
DriveObject |
transform(Object object)
Transforms a basic object into a DriveObject.
|
Object |
transformAutomatically(DriveObject statisticsObject)
Tries to automatically transform the statistics object into a registered one
|
void registerClasses(Class<?>... classes)
classes - the classes to be added. Class should contain at least one field marked with SaveVarvoid registerSerializers(CustomSerializer... serializers)
serializers - the serializers to add<T> T transform(DriveObject statisticsObject, Class<T> clazz)
T - type of targetstatisticsObject - the object to convertclazz - target clazz to convert toClassCastException - if object can not be transformed.List createList(DriveElementArray array, Class clazz, Object parent)
array - array to transformclazz - target clazzparent - optional parent instanceClassCastException - thrown when two lists are in one anotherDriveObject transform(Object object)
object - object to transformClassCastException - thrown when object can not be transformedObject transformAutomatically(DriveObject statisticsObject)
statisticsObject - object to be transformedvoid setService(DriveService service)
service - service the reader is used byCopyright © 2020. All rights reserved.