public interface SerializationStrategy
T.
Implementations of this interface define methods for reading, instantiating,
and providing metadata about the serialized format.| Modifier and Type | Method and Description |
|---|---|
@NotNull BracketType |
bracketType()
Provides the bracket type used in the serialized format, which might
give hints or constraints on how the data is structured.
|
<T> T |
newInstanceOrNull(Class<T> type)
Constructs and returns a new instance of the provided
type
as a reference. |
<T> T |
readUsing(Class<?> clazz,
T using,
ValueIn in,
BracketType bracketType)
Reads an object of type
T from the provided input source and populates
the given 'using' object, if not null. |
Class<?> |
type()
Returns the class type of objects this serialization strategy is designed to handle.
|
@Nullable <T> T readUsing(Class<?> clazz, T using, ValueIn in, BracketType bracketType) throws net.openhft.chronicle.core.io.InvalidMarshallableException
T from the provided input source and populates
the given 'using' object, if not null. The method uses the given BracketType
to aid in the deserialization.clazz - The class type to be deserialized.using - An optional object of type T that can be populated with the read data.
If null, a new object will be created or an exception might be thrown depending on implementation.in - The input source containing serialized data.bracketType - The type of bracket used in the serialized format.T.net.openhft.chronicle.core.io.InvalidMarshallableException - If an error occurs during the deserialization process.@Nullable <T> T newInstanceOrNull(Class<T> type)
type
as a reference. If the instance cannot be constructed for any reason,
null is returned.type - The class type for which a new instance is required.type or null if instantiation is not possible.Class<?> type()
@NotNull @NotNull BracketType bracketType()
BracketType used by this serialization strategy.Copyright © 2024. All rights reserved.