Package io.vavr.collection
Class StreamModule.SerializationProxy<T>
java.lang.Object
io.vavr.collection.StreamModule.SerializationProxy<T>
- Type Parameters:
T
- The component type of the underlying stream.
- All Implemented Interfaces:
Serializable
- Enclosing interface:
StreamModule
@GwtIncompatible("The Java serialization protocol is explicitly not supported")
public static final class StreamModule.SerializationProxy<T>
extends Object
implements Serializable
A serialization proxy which, in this context, is used to deserialize immutable, linked Streams with final
instance fields.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSerializationProxy
(Stream.Cons<T> stream) Constructor for the case of serialization. -
Method Summary
Modifier and TypeMethodDescriptionprivate void
Read an object from a deserialization stream.private Object
readResolve
method for the serialization proxy pattern.private void
Write an object to a serialization stream.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
stream
-
-
Constructor Details
-
SerializationProxy
SerializationProxy(Stream.Cons<T> stream) Constructor for the case of serialization.The constructor of a SerializationProxy takes an argument that concisely represents the logical state of an instance of the enclosing class.
- Parameters:
stream
- a Cons
-
-
Method Details
-
writeObject
Write an object to a serialization stream.- Parameters:
s
- An object serialization stream.- Throws:
IOException
- If an error occurs writing to the stream.
-
readObject
Read an object from a deserialization stream.- Parameters:
s
- An object deserialization stream.- Throws:
ClassNotFoundException
- If the object's class read from the stream cannot be found.InvalidObjectException
- If the stream contains no stream elements.IOException
- If an error occurs reading from the stream.
-
readResolve
readResolve
method for the serialization proxy pattern.Returns a logically equivalent instance of the enclosing class. The presence of this method causes the serialization system to translate the serialization proxy back into an instance of the enclosing class upon deserialization.
- Returns:
- A deserialized instance of the enclosing class.
-