- Type Parameters:
T- The type of the optional value.
A codec for optional values.
-
Nested Class Summary
Nested classes/interfaces inherited from class dev.argon.esexpr.ESExprCodec
ESExprCodec.FailurePath -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondecode(ESExpr expr, ESExprCodec.FailurePath path) Decode an ESExpr into a value.Encode a value into an ESExpr.booleanisEncodedEqual(Optional<T> x, Optional<T> y) Determines whether two values are equal when encoded as an `ESExpr`.tags()Gets the set of tags of values for this type.Methods inherited from class dev.argon.esexpr.ESExprCodec
decode, optionalCodec
-
Constructor Details
-
OptionalCodec
Create a codec for optional values.- Parameters:
itemCodec- The underlying codec for the values.
-
-
Method Details
-
tags
Description copied from class:ESExprCodecGets the set of tags of values for this type.- Specified by:
tagsin classESExprCodec<Optional<T>>- Returns:
- The set of tags.
-
isEncodedEqual
Description copied from class:ESExprCodecDetermines whether two values are equal when encoded as an `ESExpr`.- Specified by:
isEncodedEqualin classESExprCodec<Optional<T>>- Parameters:
x- The first value.y- The second value.- Returns:
- true iff the values are equal when encoded.
-
encode
Description copied from class:ESExprCodecEncode a value into an ESExpr.- Specified by:
encodein classESExprCodec<Optional<T>>- Parameters:
value- The value to encode.- Returns:
- The encoded ESExpr.
-
decode
Description copied from class:ESExprCodecDecode an ESExpr into a value.- Specified by:
decodein classESExprCodec<Optional<T>>- Parameters:
expr- The ESExpr to decode.path- The path of the current value within the decoded object for diagnostic purposes.- Returns:
- The decoded value.
- Throws:
DecodeException- when the value cannot be decoded.
-