Class CustomBinaryHandler<T>
java.lang.Object
one.microstream.persistence.types.PersistenceTypeHandler.Abstract<Binary,T>
one.microstream.persistence.binary.types.BinaryTypeHandler.Abstract<T>
one.microstream.persistence.binary.internal.AbstractBinaryHandlerCustom<T>
one.microstream.persistence.binary.internal.CustomBinaryHandler<T>
- All Implemented Interfaces:
BinaryTypeHandler<T>
,PersistenceDataTypeHolder<Binary>
,PersistenceTypeDefinition
,PersistenceTypeDescription
,PersistenceTypeHandler<Binary,T>
,PersistenceTypeIdentity
,PersistenceTypeIdOwner
,PersistenceTypeLink
- Direct Known Subclasses:
BinaryHandlerInetSocketAddress
public class CustomBinaryHandler<T> extends AbstractBinaryHandlerCustom<T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface one.microstream.persistence.binary.types.BinaryTypeHandler
BinaryTypeHandler.Abstract<T>
Nested classes/interfaces inherited from interface one.microstream.persistence.types.PersistenceDataTypeHolder
PersistenceDataTypeHolder.Default<D>
Nested classes/interfaces inherited from interface one.microstream.persistence.types.PersistenceTypeDefinition
PersistenceTypeDefinition.Default
Nested classes/interfaces inherited from interface one.microstream.persistence.types.PersistenceTypeDescription
PersistenceTypeDescription.Identity
Nested classes/interfaces inherited from interface one.microstream.persistence.types.PersistenceTypeHandler
PersistenceTypeHandler.Abstract<D,T>
-
Constructor Summary
Constructors Modifier Constructor Description protected
CustomBinaryHandler(Class<T> type)
protected
CustomBinaryHandler(Class<T> type, String typeName, XGettingSequence<? extends BinaryField<? super T>> binaryFields)
protected
CustomBinaryHandler(Class<T> type, String typeName, PersistenceTypeInstantiator<Binary,T> instantiator, XGettingSequence<? extends BinaryField<? super T>> binaryFields)
protected
CustomBinaryHandler(Class<T> type, XGettingSequence<? extends BinaryField<? super T>> binaryFields)
protected
CustomBinaryHandler(Class<T> type, PersistenceTypeInstantiator<Binary,T> instantiator)
protected
CustomBinaryHandler(Class<T> type, PersistenceTypeInstantiator<Binary,T> instantiator, XGettingSequence<? extends BinaryField<? super T>> binaryFields)
-
Method Summary
Modifier and Type Method Description protected void
collectDeclaredBinaryFields(Class<?> clazz, XAddingCollection<BinaryField.Initializable<T>> target)
void
complete(Binary data, T instance, PersistenceLoadHandler handler)
Completes an initially built instance after all loaded instances have been built.T
create(Binary data, PersistenceLoadHandler handler)
protected void
defineBinaryFieldOrder(XGettingTable<Class<?>,XGettingSequence<BinaryField.Initializable<T>>> binaryFieldsPerClass, BiConsumer<String,BinaryField.Initializable<T>> collector)
protected static <T, R> BinaryField<T>
Field(Class<R> referenceType, Getter<T,R> getter)
protected static <T, R> BinaryField<T>
Field(Class<R> referenceType, Getter<T,R> getter, Setter<T,R> setter)
protected static <T> BinaryField<T>
Field_boolean(Getter_boolean<T> getter)
protected static <T> BinaryField<T>
Field_boolean(Getter_boolean<T> getter, Setter_boolean<T> setter)
protected static <T> BinaryField<T>
Field_byte(Getter_byte<T> getter)
protected static <T> BinaryField<T>
Field_byte(Getter_byte<T> getter, Setter_byte<T> setter)
protected static <T> BinaryField<T>
Field_char(Getter_char<T> getter)
protected static <T> BinaryField<T>
Field_char(Getter_char<T> getter, Setter_char<T> setter)
protected static <T> BinaryField<T>
Field_double(Getter_double<T> getter)
protected static <T> BinaryField<T>
Field_double(Getter_double<T> getter, Setter_double<T> setter)
protected static <T> BinaryField<T>
Field_float(Getter_float<T> getter)
protected static <T> BinaryField<T>
Field_float(Getter_float<T> getter, Setter_float<T> setter)
protected static <T> BinaryField<T>
Field_int(Getter_int<T> getter)
protected static <T> BinaryField<T>
Field_int(Getter_int<T> getter, Setter_int<T> setter)
protected static <T> BinaryField<T>
Field_long(Getter_long<T> getter)
protected static <T> BinaryField<T>
Field_long(Getter_long<T> getter, Setter_long<T> setter)
protected static <T> BinaryField<T>
Field_short(Getter_short<T> getter)
protected static <T> BinaryField<T>
Field_short(Getter_short<T> getter, Setter_short<T> setter)
boolean
hasPersistedReferences()
boolean
hasVaryingPersistedLengthInstances()
Provides information if one particular instance can have variing binary length from one store to another.protected EqConstHashTable<String,? extends BinaryField<? super T>>
initializeDefinedFields(XGettingSequence<? extends BinaryField<? super T>> binaryFields)
protected XImmutableEnum<? extends PersistenceTypeDefinitionMember>
initializeInstanceMembers()
void
initializeState(Binary data, T instance, PersistenceLoadHandler handler)
protected T
instantiate(Binary data)
void
iterateInstanceReferences(T instance, PersistenceFunction iterator)
void
iterateLoadableReferences(Binary data, PersistenceReferenceLoader loader)
<C extends Consumer<? super Class<?>>>
CiterateMemberTypes(C logic)
Iterates the types of persistent members (e.g.static <T> CustomBinaryHandler<T>
New(Class<T> type, PersistenceTypeInstantiator<Binary,T> instantiator, XGettingSequence<? extends BinaryField<? super T>> binaryFields)
protected XGettingSequence<? extends BinaryField<? super T>>
reflectiveInitializeBinaryFields()
void
store(Binary data, T instance, long objectId, PersistenceStoreHandler<Binary> handler)
void
updateState(Binary data, T instance, PersistenceLoadHandler handler)
protected void
validateBinaryFieldGenericType(Field binaryFieldField)
protected void
validateReadOnlyFields(T instance, Binary data, PersistenceLoadHandler handler)
Methods inherited from class one.microstream.persistence.binary.internal.AbstractBinaryHandlerCustom
allMembers, bytes, calculcateBinaryLengths, chars, Complex, CustomField, CustomField, CustomFields, defineValueType, ensureInitializeInstanceMembers, getInstanceFieldOfType, instanceMembers, isPrimitiveType, keyValuesFields, membersPersistedLengthMaximum, membersPersistedLengthMinimum, SimpleArrayFields, SizedArrayFields
Methods inherited from class one.microstream.persistence.binary.types.BinaryTypeHandler.Abstract
declaredField, declaredField
Methods inherited from class one.microstream.persistence.types.PersistenceTypeHandler.Abstract
declaredField, declaredFields, deriveTypeName, initialize, internalInitialize, toString, type, typeId, typeName, validateAndImmure, validateInstance
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface one.microstream.persistence.binary.types.BinaryTypeHandler
dataType
Methods inherited from interface one.microstream.persistence.types.PersistenceTypeDefinition
hasPersistedVariableLength, runtimeTypeName, toRuntimeTypeIdentifier, typeId, typeName
Methods inherited from interface one.microstream.persistence.types.PersistenceTypeDescription
instancePrimitiveMembers, instanceReferenceMembers, toTypeIdentifier
Methods inherited from interface one.microstream.persistence.types.PersistenceTypeHandler
collectEnumConstants, getPersistedEnumOrdinal, guaranteeSpecificInstanceViablity, guaranteeSubTypeInstanceViablity, initialize, isSpecificInstanceViable, isSubTypeInstanceViable, isValidEntityType, membersInDeclaredOrder, settingMembers, storingMembers, type, validateEntityType
-
Constructor Details
-
CustomBinaryHandler
-
CustomBinaryHandler
protected CustomBinaryHandler(Class<T> type, XGettingSequence<? extends BinaryField<? super T>> binaryFields) -
CustomBinaryHandler
protected CustomBinaryHandler(Class<T> type, String typeName, XGettingSequence<? extends BinaryField<? super T>> binaryFields) -
CustomBinaryHandler
-
CustomBinaryHandler
protected CustomBinaryHandler(Class<T> type, PersistenceTypeInstantiator<Binary,T> instantiator, XGettingSequence<? extends BinaryField<? super T>> binaryFields) -
CustomBinaryHandler
protected CustomBinaryHandler(Class<T> type, String typeName, PersistenceTypeInstantiator<Binary,T> instantiator, XGettingSequence<? extends BinaryField<? super T>> binaryFields)
-
-
Method Details
-
Field_byte
-
Field_byte
-
Field_boolean
-
Field_boolean
protected static final <T> BinaryField<T> Field_boolean(Getter_boolean<T> getter, Setter_boolean<T> setter) -
Field_short
-
Field_short
protected static final <T> BinaryField<T> Field_short(Getter_short<T> getter, Setter_short<T> setter) -
Field_char
-
Field_char
-
Field_int
-
Field_int
-
Field_float
-
Field_float
protected static final <T> BinaryField<T> Field_float(Getter_float<T> getter, Setter_float<T> setter) -
Field_long
-
Field_long
-
Field_double
-
Field_double
protected static final <T> BinaryField<T> Field_double(Getter_double<T> getter, Setter_double<T> setter) -
Field
-
Field
protected static final <T, R> BinaryField<T> Field(Class<R> referenceType, Getter<T,R> getter, Setter<T,R> setter) -
initializeDefinedFields
protected EqConstHashTable<String,? extends BinaryField<? super T>> initializeDefinedFields(XGettingSequence<? extends BinaryField<? super T>> binaryFields) -
New
public static <T> CustomBinaryHandler<T> New(Class<T> type, PersistenceTypeInstantiator<Binary,T> instantiator, XGettingSequence<? extends BinaryField<? super T>> binaryFields) -
hasPersistedReferences
public final boolean hasPersistedReferences() -
hasVaryingPersistedLengthInstances
public final boolean hasVaryingPersistedLengthInstances()Description copied from interface:PersistenceTypeDefinition
Provides information if one particular instance can have variing binary length from one store to another.Examples for variable length instances:
- variable size collection instances
- variable size pesudo collection instances like
java.util.StringBuilder
- instances of custom defined types similar to collections
Examples for fixed length instances:
- arrays
- all immutable type instances (like
java.lang.String
) - all fixed length types (see
PersistenceTypeDefinition.hasVaryingPersistedLengthInstances()
-
initializeInstanceMembers
- Overrides:
initializeInstanceMembers
in classAbstractBinaryHandlerCustom<T>
-
store
- Specified by:
store
in interfacePersistenceTypeHandler<Binary,T>
- Specified by:
store
in classAbstractBinaryHandlerCustom<T>
-
instantiate
-
create
- Specified by:
create
in interfacePersistenceTypeHandler<Binary,T>
- Specified by:
create
in classAbstractBinaryHandlerCustom<T>
-
initializeState
-
updateState
-
validateReadOnlyFields
-
complete
Description copied from interface:PersistenceTypeHandler
Completes an initially built instance after all loaded instances have been built. E.g. can be used to cause a hash collection to hash all its initially collected entries after their instances have been built.- Specified by:
complete
in interfacePersistenceTypeHandler<Binary,T>
- Overrides:
complete
in classAbstractBinaryHandlerCustom<T>
-
iterateMemberTypes
Description copied from interface:PersistenceTypeHandler
Iterates the types of persistent members (e.g. non-transientField
s). The same type may occur more than once. The order in which the types are provided is undefined, i.e. depending on the implementation.- Specified by:
iterateMemberTypes
in interfacePersistenceTypeHandler<Binary,T>
- Overrides:
iterateMemberTypes
in classAbstractBinaryHandlerCustom<T>
-
reflectiveInitializeBinaryFields
protected final XGettingSequence<? extends BinaryField<? super T>> reflectiveInitializeBinaryFields() -
validateBinaryFieldGenericType
-
collectDeclaredBinaryFields
protected void collectDeclaredBinaryFields(Class<?> clazz, XAddingCollection<BinaryField.Initializable<T>> target) -
defineBinaryFieldOrder
protected void defineBinaryFieldOrder(XGettingTable<Class<?>,XGettingSequence<BinaryField.Initializable<T>>> binaryFieldsPerClass, BiConsumer<String,BinaryField.Initializable<T>> collector) -
iterateInstanceReferences
- Specified by:
iterateInstanceReferences
in interfacePersistenceTypeHandler<Binary,T>
- Overrides:
iterateInstanceReferences
in classAbstractBinaryHandlerCustom<T>
-
iterateLoadableReferences
-