Package org.springframework.aot.hint
Class SerializationHints
java.lang.Object
org.springframework.aot.hint.SerializationHints
Gather the need for Java serialization at runtime.
- Since:
- 6.0
- Author:
- Stephane Nicoll
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturn thejava serialization hints
for types that need to be serialized using Java serialization at runtime.registerType
(Class<? extends Serializable> type) Register that the specified type need to be serialized using java serialization.registerType
(Class<? extends Serializable> type, Consumer<JavaSerializationHint.Builder> serializationHint) Register that the specified type need to be serialized using java serialization.registerType
(TypeReference type) Register that the type defined by the specifiedTypeReference
need to be serialized using java serialization.registerType
(TypeReference type, Consumer<JavaSerializationHint.Builder> serializationHint) Register that the type defined by the specifiedTypeReference
need to be serialized using java serialization.
-
Constructor Details
-
SerializationHints
public SerializationHints()
-
-
Method Details
-
javaSerialization
Return thejava serialization hints
for types that need to be serialized using Java serialization at runtime.- Returns:
- a stream of
java serialization hints
-
registerType
public SerializationHints registerType(TypeReference type, @Nullable Consumer<JavaSerializationHint.Builder> serializationHint) Register that the type defined by the specifiedTypeReference
need to be serialized using java serialization.- Parameters:
type
- the type to registerserializationHint
- a builder to further customize the serialization- Returns:
this
, to facilitate method chaining
-
registerType
Register that the type defined by the specifiedTypeReference
need to be serialized using java serialization.- Parameters:
type
- the type to register- Returns:
this
, to facilitate method chaining
-
registerType
public SerializationHints registerType(Class<? extends Serializable> type, @Nullable Consumer<JavaSerializationHint.Builder> serializationHint) Register that the specified type need to be serialized using java serialization.- Parameters:
type
- the type to registerserializationHint
- a builder to further customize the serialization- Returns:
this
, to facilitate method chaining
-
registerType
Register that the specified type need to be serialized using java serialization.- Parameters:
type
- the type to register- Returns:
this
, to facilitate method chaining
-