- Type Parameters:
T- The type of the optional value.
- All Known Implementing Classes:
OptionalOptionalValueCodec
public interface OptionalValueCodec<T>
A codec for optional values.
-
Method Summary
Modifier and TypeMethodDescriptiondecodeOptional(Optional<ESExpr> expr, ESExprCodec.FailurePath path) Decode an optional expression into an optional value.encodeOptional(T value) Encode an optional value into an optional expression.
-
Method Details
-
encodeOptional
-
decodeOptional
T decodeOptional(Optional<ESExpr> expr, @NotNull ESExprCodec.FailurePath path) throws DecodeException Decode an optional expression into an optional value.- Parameters:
expr- The optional expression.path- The path of the current value within the decoded object for diagnostic purposes.- Returns:
- The optional value.
- Throws:
DecodeException- when the value cannot be decoded.
-