Class AbstractTypeIdProvider
java.lang.Object
com.pnfsoftware.jeb.util.serialization.AbstractTypeIdProvider
- All Implemented Interfaces:
ITypeIdProvider
- Direct Known Subclasses:
NativeTypeIdProvider
Base class for a type-id provider used for serialization. Type-id providers can be used to
de-couple the a saved object from its type name. The type-id can be saved instead, allowing type
names to change without breaking the deserialization process.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAll(ITypeIdProvider provider) Add of types from a provider to this provider.intGet the ype-id of a given type.getMap()Get the map of type to type-id.Get the reverse type-id map, mapping a type-id to a type.Class<?>getType(int typeId) Get a type by type-id.protected abstract void
-
Constructor Details
-
AbstractTypeIdProvider
protected AbstractTypeIdProvider()
-
-
Method Details
-
getId
Description copied from interface:ITypeIdProviderGet the ype-id of a given type.- Specified by:
getIdin interfaceITypeIdProvider- Parameters:
c- the non-null type- Returns:
- 0 if the provider cannot find a corresponding type-id for the provided type
-
getType
Description copied from interface:ITypeIdProviderGet a type by type-id.- Specified by:
getTypein interfaceITypeIdProvider- Parameters:
typeId- the non-zero type-id- Returns:
- the type, null if not found
-
getMap
Description copied from interface:ITypeIdProviderGet the map of type to type-id.- Specified by:
getMapin interfaceITypeIdProvider- Returns:
- the type-id map
-
getReverseMap
Description copied from interface:ITypeIdProviderGet the reverse type-id map, mapping a type-id to a type.- Specified by:
getReverseMapin interfaceITypeIdProvider- Returns:
- the reverse type-id map
-
addAll
Description copied from interface:ITypeIdProviderAdd of types from a provider to this provider.- Specified by:
addAllin interfaceITypeIdProvider- Parameters:
provider- another provider
-
loadTypes
-