public class WireSerializedLambda extends Object implements ReadMarshallable, net.openhft.chronicle.core.util.ReadResolvable
This allows lambdas that are Serializable to be written to and read
from a Wire, preserving their capturing arguments and target functional
interface method. It effectively mimics Java's built-in lambda serialisation
mechanism for Chronicle Wire.
DISCARD| Constructor and Description |
|---|
WireSerializedLambda() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isSerializableLambda(@NotNull Class<?> clazz)
Checks whether
clazz represents a lambda class that also implements
Serializable. |
void |
readMarshallable(@NotNull WireIn wire)
Deserialises this
WireSerializedLambda from the given wire. |
@NotNull Object |
readResolve()
Recreates the original lambda instance from the deserialised state.
|
static <L> void |
write(L lambda,
@NotNull ValueOut valueOut)
Writes a serialisable lambda to the supplied
ValueOut. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitunexpectedFieldpublic static boolean isSerializableLambda(@NotNull
@NotNull Class<?> clazz)
clazz represents a lambda class that also implements
Serializable.clazz - class to checktrue if clazz is a serialisable lambdapublic static <L> void write(@NotNull
L lambda,
@NotNull
@NotNull ValueOut valueOut)
ValueOut.
The lambda's writeReplace method yields a SerializedLambda,
which is written as a WireSerializedLambda.
L - the type of the lambda expressionlambda - the serialisable lambda instancevalueOut - target for the lambda's serialised formpublic void readMarshallable(@NotNull
@NotNull WireIn wire)
throws IllegalStateException
WireSerializedLambda from the given wire.
All fields corresponding to SerializedLambda properties are read.readMarshallable in interface ReadMarshallablewire - The wire input from which the object's state should be read.IllegalStateException@NotNull public @NotNull Object readResolve()
readMarshallable(WireIn).readResolve in interface net.openhft.chronicle.core.util.ReadResolvableCopyright © 2026 Chronicle Software Ltd. All rights reserved.