Package org.springframework.aot.hint

# Class SerializationHints

java.lang.Object
org.springframework.aot.hint.SerializationHints

public class SerializationHints extends Object
Gather the need for Java serialization at runtime.

Since:
  6.0
Author:
  Stephane Nicoll
See Also:
  - `Serializable`

## Constructor Summary

Constructors
Constructor
Description
`SerializationHints()`

## Method Summary

Modifier and Type
Method
Description
`Stream<JavaSerializationHint>`
`javaSerializationHints()`
Return the `java serialization hints` for types that need to be serialized using Java serialization at runtime.
`SerializationHints`
`registerType(Class<? extends Serializable> type)`
Register that the specified type need to be serialized using java serialization.
`SerializationHints`
`registerType(Class<? extends Serializable> type, Consumer<JavaSerializationHint.Builder> serializationHint)`
Register that the specified type need to be serialized using java serialization.
`SerializationHints`
`registerType(TypeReference type)`
Register that the type defined by the specified `TypeReference` need to be serialized using java serialization.
`SerializationHints`
`registerType(TypeReference type, Consumer<JavaSerializationHint.Builder> serializationHint)`
Register that the type defined by the specified `TypeReference` need to be serialized using java serialization.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### SerializationHints

public SerializationHints()

## Method Details

### javaSerializationHints

public Stream<JavaSerializationHint> javaSerializationHints()
Return the `java 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 specified `TypeReference` need to be serialized using java serialization.

Parameters:
  `type` - the type to register
  `serializationHint` - a builder to further customize the serialization
Returns:
  `this`, to facilitate method chaining

### registerType

public SerializationHints registerType(TypeReference type)
Register that the type defined by the specified `TypeReference` 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 register
  `serializationHint` - a builder to further customize the serialization
Returns:
  `this`, to facilitate method chaining

### registerType

public SerializationHints registerType(Class<? extends Serializable> type)
Register that the specified type need to be serialized using java serialization.

Parameters:
  `type` - the type to register
Returns:
  `this`, to facilitate method chaining