- All Implemented Interfaces:
Serializable,Comparable<UnknownTypeStrategy>,Constable
Defines the strategy for handling unknown or unresolvable types during deserialization.
This is used by Serializer implementations to determine how to proceed when a type identifier is not
recognized (e.g., missing class, renamed type).
AS_INTERMEDIATE– Treat unknown types as intermediate representations. Deserialization may still proceed later based on structural conversion or inspection.IGNORE– Silently skip unknown types. The deserialized stream will exclude them. Default for deserialization of tracked messages.FAIL– Immediately throw aDeserializationExceptionupon encountering an unknown type. Default for event-sourcing.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionRepresents the strategy to treat unknown or unresolvable types as intermediate representations during the deserialization process.Defines a strategy where deserialization will immediately fail by throwing aDeserializationExceptionwhen an unknown or unresolvable type is encountered.Silently skips unknown or unresolvable types during the deserialization process. -
Method Summary
Modifier and TypeMethodDescriptionstatic UnknownTypeStrategyReturns the enum constant of this class with the specified name.static UnknownTypeStrategy[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
AS_INTERMEDIATE
Represents the strategy to treat unknown or unresolvable types as intermediate representations during the deserialization process. This approach allows for deserialization to potentially proceed later based on structural conversion or further inspection, instead of immediately failing or skipping the unknown type. -
IGNORE
Silently skips unknown or unresolvable types during the deserialization process. When this strategy is applied, any type identifier that cannot be resolved will be ignored, and the deserialized output will omit the corresponding data without throwing an error.This can be useful when dealing with dynamic schemas or when backward compatibility with modified or incomplete data streams is needed.
This is the default strategy for deserializing messages from a global message log.
-
FAIL
Defines a strategy where deserialization will immediately fail by throwing aDeserializationExceptionwhen an unknown or unresolvable type is encountered.This strategy ensures strict validation of incoming data, preventing deserialization from proceeding with unrecognized or unsupported type identifiers.
Typically used in scenarios requiring high reliability and accuracy in the deserialization process.
This is the default strategy for deserializing events during event sourcing.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-