public interface SerializationStrategy
T.
Implementations read data from a ValueIn, create instances as
required and describe the wire format used. A strategy usually targets a
particular Java type or category such as enums, Marshallable
objects or collections. It dictates how objects are converted to and from a
wire representation. See SerializationStrategies for the common
built-in strategies.| 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 primary Java
Class that this strategy deals with. |
@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 - expected class of the object, or null to infer
from the wire or using instanceusing - 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 - source of the wire databracketType - hint about the expected structure such as map, sequence
or nonenull if no
instance could be obtainednet.openhft.chronicle.core.io.InvalidMarshallableException - if the deserialisation fails@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()
Class that this strategy deals with.
It may be a concrete type, an interface or a broad category such as
java.lang.Enum.@NotNull @NotNull BracketType bracketType()
BracketType used by this serialization strategy.Copyright © 2026 Chronicle Software Ltd. All rights reserved.