Module io.fluxzero.sdk
Class DefaultCasterChain.ConvertingSerializedObject<I,O>
java.lang.Object
io.fluxzero.sdk.common.serialization.casting.DefaultCasterChain.ConvertingSerializedObject<I,O>
- Type Parameters:
I- the input data type before conversionO- the output data type after conversion
- All Implemented Interfaces:
io.fluxzero.common.api.SerializedObject<O>,HasSource<io.fluxzero.common.api.SerializedObject<I>>
- Enclosing class:
DefaultCasterChain<T,S extends io.fluxzero.common.api.SerializedObject<T>>
protected static class DefaultCasterChain.ConvertingSerializedObject<I,O>
extends Object
implements io.fluxzero.common.api.SerializedObject<O>, HasSource<io.fluxzero.common.api.SerializedObject<I>>
A
SerializedObject wrapper that applies a Converter to translate data from one format to another.
This class enables the DefaultCasterChain to perform casting across multiple intermediate formats,
often used when bridging serialization formats (e.g., JSON → binary, or type-safe objects → byte arrays).
When the actual converted Data is requested, the wrapped converter will be applied lazily and memoized.
The result can be accessed via data() or extracted using getResult().
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConvertingSerializedObject(io.fluxzero.common.api.SerializedObject<I> source, io.fluxzero.common.serialization.Converter<I, O> converter) Constructs aConvertingSerializedObjectwith deferred conversion. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.fluxzero.common.api.SerializedObject
withData
-
Constructor Details
-
ConvertingSerializedObject
public ConvertingSerializedObject(io.fluxzero.common.api.SerializedObject<I> source, io.fluxzero.common.serialization.Converter<I, O> converter) Constructs aConvertingSerializedObjectwith deferred conversion.- Parameters:
source- the original serialized objectconverter- the converter to apply
-
-
Method Details
-
data
- Specified by:
datain interfaceio.fluxzero.common.api.SerializedObject<I>
-
getType
- Specified by:
getTypein interfaceio.fluxzero.common.api.SerializedObject<I>
-
getRevision
public int getRevision()- Specified by:
getRevisionin interfaceio.fluxzero.common.api.SerializedObject<I>
-
getResult
public io.fluxzero.common.api.SerializedObject<?> getResult()Returns the finalSerializedObjectafter conversion.If no transformation occurred (i.e., the result equals the source), the source object is returned directly.
- Returns:
- a converted or original serialized object
-