Top Description Fields Constructors Methods
org.springframework.aot.hint

public Class SerializationHints

extends Object
Class Inheritance
Imports
java.io.Serializable, java.util.LinkedHashSet, .Set, java.util.function.Consumer, java.util.stream.Stream, org.springframework.lang.Nullable

Gather the need for Java serialization at runtime.
Author
Stephane Nicoll
Since
6.0
See Also
Serializable

Field Summary

Modifier and TypeField and Description
private final Set<JavaSerializationHint>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Stream<JavaSerializationHint>

Returns:

a stream of java serialization hints
javaSerializationHints
()

Return the java serialization hints for types that need to be serialized using Java serialization at runtime.

public SerializationHints

Returns:

this, to facilitate method chaining
registerType
(TypeReference
the type to register
type
,
Consumer<JavaSerializationHint.Builder>
a builder to further customize the serialization
serializationHint
)

Register that the type defined by the specified TypeReference need to be serialized using java serialization.

public SerializationHints

Returns:

this, to facilitate method chaining
registerType
(TypeReference
the type to register
type
)

Register that the type defined by the specified TypeReference need to be serialized using java serialization.

public SerializationHints

Returns:

this, to facilitate method chaining
registerType
(Class<? extends Serializable>
the type to register
type
,
Consumer<JavaSerializationHint.Builder>
a builder to further customize the serialization
serializationHint
)

Register that the specified type need to be serialized using java serialization.

public SerializationHints

Returns:

this, to facilitate method chaining
registerType
(Class<? extends Serializable>
the type to register
type
)

Register that the specified type need to be serialized using java serialization.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

javaSerializationHintsback to summary
private final Set<JavaSerializationHint> javaSerializationHints

Constructor Detail

SerializationHintsback to summary
public SerializationHints()

Method Detail

javaSerializationHintsback to summary
public Stream<JavaSerializationHint> javaSerializationHints()

Return the java serialization hints for types that need to be serialized using Java serialization at runtime.

Returns:Stream<JavaSerializationHint>

a stream of java serialization hints

registerTypeback to summary
public SerializationHints registerType(TypeReference type, Consumer<JavaSerializationHint.Builder> serializationHint)

Register that the type defined by the specified TypeReference need to be serialized using java serialization.

Parameters
type:TypeReference

the type to register

serializationHint:Consumer<JavaSerializationHint.Builder>

a builder to further customize the serialization

Returns:SerializationHints

this, to facilitate method chaining

registerTypeback to summary
public SerializationHints registerType(TypeReference type)

Register that the type defined by the specified TypeReference need to be serialized using java serialization.

Parameters
type:TypeReference

the type to register

Returns:SerializationHints

this, to facilitate method chaining

registerTypeback to summary
public SerializationHints registerType(Class<? extends Serializable> type, Consumer<JavaSerializationHint.Builder> serializationHint)

Register that the specified type need to be serialized using java serialization.

Parameters
type:Class<? extends Serializable>

the type to register

serializationHint:Consumer<JavaSerializationHint.Builder>

a builder to further customize the serialization

Returns:SerializationHints

this, to facilitate method chaining

registerTypeback to summary
public SerializationHints registerType(Class<? extends Serializable> type)

Register that the specified type need to be serialized using java serialization.

Parameters
type:Class<? extends Serializable>

the type to register

Returns:SerializationHints

this, to facilitate method chaining