Interface PersistenceTypeHandler<D,T>
-
- All Superinterfaces:
PersistenceTypeDefinition
,PersistenceTypeDescription
,PersistenceTypeIdentity
,PersistenceTypeIdOwner
,PersistenceTypeLink
- All Known Subinterfaces:
BinaryLegacyTypeHandler<T>
,BinaryTypeHandler<T>
,PersistenceLegacyTypeHandler<D,T>
,PersistenceTypeHandlerCustom<D,T>
,PersistenceTypeHandlerGeneric<D,T>
,PersistenceTypeHandlerReflective<D,T>
,PersistenceUnreachableTypeHandler<D,T>
- All Known Implementing Classes:
AbstractBinaryHandlerAbstractStringBuilder
,AbstractBinaryHandlerCollection
,AbstractBinaryHandlerCustom
,AbstractBinaryHandlerCustomCollection
,AbstractBinaryHandlerCustomEnum
,AbstractBinaryHandlerCustomIterable
,AbstractBinaryHandlerCustomIterableSimpleListElements
,AbstractBinaryHandlerCustomIterableSizedArray
,AbstractBinaryHandlerCustomValue
,AbstractBinaryHandlerCustomValueFixedLength
,AbstractBinaryHandlerCustomValueVariableLength
,AbstractBinaryHandlerList
,AbstractBinaryHandlerMap
,AbstractBinaryHandlerNativeArray
,AbstractBinaryHandlerNativeArrayPrimitive
,AbstractBinaryHandlerQueue
,AbstractBinaryHandlerReflective
,AbstractBinaryHandlerSet
,AbstractBinaryHandlerStateless
,AbstractBinaryHandlerTrivial
,AbstractBinaryLegacyTypeHandlerReflective
,AbstractBinaryLegacyTypeHandlerTranslating
,BinaryHandlerAbstractType
,BinaryHandlerArrayDeque
,BinaryHandlerArrayList
,BinaryHandlerArrayList
,BinaryHandlerBigDecimal
,BinaryHandlerBigInteger
,BinaryHandlerBoolean
,BinaryHandlerBulkList
,BinaryHandlerByte
,BinaryHandlerCharacter
,BinaryHandlerClass
,BinaryHandlerConcurrentHashMap
,BinaryHandlerConcurrentLinkedDeque
,BinaryHandlerConcurrentLinkedQueue
,BinaryHandlerConcurrentSkipListMap
,BinaryHandlerConcurrentSkipListSet
,BinaryHandlerConstHashEnum
,BinaryHandlerConstHashTable
,BinaryHandlerConstList
,BinaryHandlerCopyOnWriteArrayList
,BinaryHandlerCustomEnumTrivial
,BinaryHandlerDate
,BinaryHandlerDouble
,BinaryHandlerEqBulkList
,BinaryHandlerEqConstHashEnum
,BinaryHandlerEqConstHashTable
,BinaryHandlerEqHashEnum
,BinaryHandlerEqHashTable
,BinaryHandlerFile
,BinaryHandlerFixedList
,BinaryHandlerFloat
,BinaryHandlerGenericCollection
,BinaryHandlerGenericEnum
,BinaryHandlerGenericList
,BinaryHandlerGenericMap
,BinaryHandlerGenericQueue
,BinaryHandlerGenericSet
,BinaryHandlerGenericType
,BinaryHandlerHashEnum
,BinaryHandlerHashMap
,BinaryHandlerHashMap
,BinaryHandlerHashMapFlattened
,BinaryHandlerHashSet
,BinaryHandlerHashSet
,BinaryHandlerHashtable
,BinaryHandlerHashtable
,BinaryHandlerHashTable
,BinaryHandlerHashtableFlattened
,BinaryHandlerIdentityHashMap
,BinaryHandlerInteger
,BinaryHandlerLazyDefault
,BinaryHandlerLimitList
,BinaryHandlerLinkedHashMap
,BinaryHandlerLinkedHashMap
,BinaryHandlerLinkedHashMapFlattened
,BinaryHandlerLinkedHashSet
,BinaryHandlerLinkedHashSet
,BinaryHandlerLinkedList
,BinaryHandlerLocale
,BinaryHandlerLong
,BinaryHandlerNativeArray_boolean
,BinaryHandlerNativeArray_byte
,BinaryHandlerNativeArray_char
,BinaryHandlerNativeArray_double
,BinaryHandlerNativeArray_float
,BinaryHandlerNativeArray_int
,BinaryHandlerNativeArray_long
,BinaryHandlerNativeArray_short
,BinaryHandlerNativeArrayObject
,BinaryHandlerNoOp
,BinaryHandlerObject
,BinaryHandlerOptionalDouble
,BinaryHandlerOptionalInt
,BinaryHandlerOptionalLong
,BinaryHandlerPath
,BinaryHandlerPersistenceRootsDefault
,BinaryHandlerPrimitive
,BinaryHandlerPriorityQueue
,BinaryHandlerPriorityQueue
,BinaryHandlerProperties
,BinaryHandlerProperties
,BinaryHandlerRootReferenceDefault
,BinaryHandlerShort
,BinaryHandlerSingleton
,BinaryHandlerSingletonStatelessEnum
,BinaryHandlerStack
,BinaryHandlerStack
,BinaryHandlerStateless
,BinaryHandlerStatelessConstant
,BinaryHandlerString
,BinaryHandlerStringBuffer
,BinaryHandlerStringBuilder
,BinaryHandlerSubstituterDefault
,BinaryHandlerTreeMap
,BinaryHandlerTreeSet
,BinaryHandlerUnpersistable
,BinaryHandlerVector
,BinaryHandlerVector
,BinaryHandlerVoid
,BinaryHandlerWeakHashMap
,BinaryLegacyTypeHandler.Abstract
,BinaryLegacyTypeHandler.AbstractCustom
,BinaryLegacyTypeHandlerGenericEnum
,BinaryLegacyTypeHandlerGenericEnumMapped
,BinaryLegacyTypeHandlerGenericType
,BinaryLegacyTypeHandlerRerouting
,BinaryTypeHandler.Abstract
,PersistenceLegacyTypeHandler.Abstract
,PersistenceLegacyTypeHandlerWrapper
,PersistenceLegacyTypeHandlerWrapperEnum
,PersistenceTypeHandler.Abstract
,PersistenceUnreachableTypeHandler.Default
public interface PersistenceTypeHandler<D,T> extends PersistenceTypeDefinition
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
PersistenceTypeHandler.Abstract<D,T>
-
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
-
-
Method Summary
-
Methods inherited from interface one.microstream.persistence.types.PersistenceTypeDefinition
hasPersistedReferences, hasPersistedVariableLength, hasVaryingPersistedLengthInstances, isPrimitiveType, membersPersistedLengthMaximum, membersPersistedLengthMinimum, runtimeTypeName, toRuntimeTypeIdentifier, typeId, typeName
-
Methods inherited from interface one.microstream.persistence.types.PersistenceTypeDescription
instancePrimitiveMembers, instanceReferenceMembers, toTypeIdentifier
-
-
-
-
Method Detail
-
type
Class<T> type()
- Specified by:
type
in interfacePersistenceTypeDefinition
- Specified by:
type
in interfacePersistenceTypeLink
-
allMembers
XGettingEnum<? extends PersistenceTypeDefinitionMember> allMembers()
- Specified by:
allMembers
in interfacePersistenceTypeDefinition
- Specified by:
allMembers
in interfacePersistenceTypeDescription
-
instanceMembers
XGettingEnum<? extends PersistenceTypeDefinitionMember> instanceMembers()
Description copied from interface:PersistenceTypeDefinition
Enum (unique elements with order), usingPersistenceTypeDescriptionMember.identityHashEqualator()
. Contains all persistent members (similar, but not identical to fields) in persistent order, which can differ from the declaration order.- Specified by:
instanceMembers
in interfacePersistenceTypeDefinition
- Specified by:
instanceMembers
in interfacePersistenceTypeDescription
-
hasInstanceReferences
boolean hasInstanceReferences()
-
iterateInstanceReferences
void iterateInstanceReferences(T instance, PersistenceFunction iterator)
-
iterateLoadableReferences
void iterateLoadableReferences(D data, PersistenceReferenceLoader iterator)
-
store
void store(D data, T instance, long objectId, PersistenceStoreHandler handler)
-
create
T create(D data, PersistenceLoadHandler handler)
-
initializeState
default void initializeState(D data, T instance, PersistenceLoadHandler handler)
-
updateState
void updateState(D data, T instance, PersistenceLoadHandler handler)
-
complete
void complete(D data, T instance, PersistenceLoadHandler handler)
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.- Parameters:
data
-instance
-handler
-
-
initialize
PersistenceTypeHandler<D,T> initialize(long typeId)
-
iterateMemberTypes
<C extends Consumer<? super Class<?>>> C iterateMemberTypes(C logic)
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.- Parameters:
logic
-
-
membersInDeclaredOrder
default XGettingEnum<? extends PersistenceTypeDefinitionMember> membersInDeclaredOrder()
-
storingMembers
default XGettingEnum<? extends PersistenceTypeDescriptionMember> storingMembers()
-
settingMembers
default XGettingEnum<? extends PersistenceTypeDescriptionMember> settingMembers()
-
guaranteeSpecificInstanceViablity
default void guaranteeSpecificInstanceViablity() throws PersistenceExceptionTypeNotPersistable
Guarantees that thePersistenceTypeHandler
implementation is actually viably usable to handle instances. That is the natural purpose of type handlers, but there are exceptions, like type handlers created for abstract types or unpersistable types just to have a metadata representation that links a type and a type id.See occurances of
PersistenceExceptionTypeNotPersistable
.- Throws:
PersistenceExceptionTypeNotPersistable
- See Also:
PersistenceExceptionTypeNotPersistable
-
isSpecificInstanceViable
default boolean isSpecificInstanceViable()
-
guaranteeSubTypeInstanceViablity
default void guaranteeSubTypeInstanceViablity() throws PersistenceExceptionTypeNotPersistable
-
isSubTypeInstanceViable
default boolean isSubTypeInstanceViable()
-
collectEnumConstants
default Object[] collectEnumConstants()
-
getPersistedEnumOrdinal
default int getPersistedEnumOrdinal(D data)
-
resolveEnumConstant
static <T,M> T resolveEnumConstant(Class<T> type, int ordinal)
-
-