Interface DataStore
public interface DataStore
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic DataStore.Builderbuilder()Returns theDataStorebuilder.voiddeserialize(DataManipulator.Mutable dataManipulator, DataView view) Deserializes the data from theDataViewand puts it in theDataManipulator.Mutable.default DataManipulator.Mutabledeserialize(DataView view) Deserializes theDataViewas aDataManipulator.Mutable.of(Key<V> key, DataQuery dataQuery, io.leangen.geantyref.TypeToken<? extends DataHolder> typeToken, io.leangen.geantyref.TypeToken<? extends DataHolder>... typeTokens) of(Key<V> key, DataQuery dataQuery, Class<? extends DataHolder> type, Class<? extends DataHolder>... types) default DataViewSerializes theValues.default DataViewdefault DataViewserialize(DataManipulator dataManipulator) Serializes the values of theDataManipulator.serialize(DataManipulator dataManipulator, DataView view) Serializes the values of theDataManipulatorinto theDataView.Gets the supportedDataHoldertypes.
-
Method Details
-
supportedTypes
Collection<Type> supportedTypes()Gets the supportedDataHoldertypes.Every returned
Typewill be a subtype ofDataHolder.- Returns:
- The supported dataHolder type.
-
serialize
Serializes the values of theDataManipulatorinto theDataView.- Parameters:
dataManipulator- The data manipulatorview- The data view to serialize to- Returns:
- The view, for chaining
-
serialize
- Parameters:
values- The values to serializeview- The view- Returns:
- The view, for chaining
-
serialize
Serializes theValues.- Parameters:
values- The value container- Returns:
- This view, for chaining
-
serialize
Serializes the values of theDataManipulator.- Parameters:
dataManipulator- The data manipulator- Returns:
- This view, for chaining
-
deserialize
Deserializes the data from theDataViewand puts it in theDataManipulator.Mutable.- Parameters:
dataManipulator- The mutable data manipulatorview- The data view to deserialize
-
deserialize
Deserializes theDataViewas aDataManipulator.Mutable.- Parameters:
view- The data view to deserialize- Returns:
- The value store
-
of
@SafeVarargs static <T,V extends Value<T>> DataStore of(Key<V> key, DataQuery dataQuery, io.leangen.geantyref.TypeToken<? extends DataHolder> typeToken, io.leangen.geantyref.TypeToken<? extends DataHolder>... typeTokens) Provides aDataStorefor a singleKey.Note that default deserializers do not support
Collection,Mapor Array types! UseDataStore.Builder.SerializersStep.key(Key, BiConsumer, Function)for these.- Parameters:
key- The data keydataQuery- The dataQuery to serialize this key undertypeTokens- The dataHolder types- Returns:
- The new data store
-
of
@SafeVarargs static <T,V extends Value<T>> DataStore of(Key<V> key, DataQuery dataQuery, Class<? extends DataHolder> type, Class<? extends DataHolder>... types) Provides aDataStorefor a singleKey.Note that default deserializers do not support
Collection,Mapor Array types! UseDataStore.Builder.SerializersStep.key(Key, BiConsumer, Function)for these.- Parameters:
key- The data keydataQuery- The dataQuery to serialize this key undertypes- The dataHolder types- Returns:
- The new data store
-
builder
Returns theDataStorebuilder.- Returns:
- The dataStore builder.
-