java.lang.Object
dev.argon.esexpr.codecs.ListVarargCodec<T>
- Type Parameters:
T- The element type.
- All Implemented Interfaces:
VarargCodec<List<T>,T>
A VarArgCodec for List values.
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.argon.esexpr.VarargCodec
VarargCodec.PositionalPathBuilder -
Constructor Summary
ConstructorsConstructorDescriptionListVarargCodec(ESExprCodec<T> elementCodec) Creates a VarArgCodec for List values. -
Method Summary
Modifier and TypeMethodDescriptiondecodeVararg(Deque<ESExpr> exprs, VarargCodec.PositionalPathBuilder pathBuilder) Decode a list of expressions into a variable argument value.voidencodeVararg(List<T> value, List<ESExpr> exprs) Encode a variable argument value into a list of expressions.booleanisEncodedEqual(List<T> x, List<T> y) Determines whether two variable argument values are encoded equally.
-
Constructor Details
-
ListVarargCodec
Creates a VarArgCodec for List values.- Parameters:
elementCodec- A value codec for the element type.
-
-
Method Details
-
isEncodedEqual
Description copied from interface:VarargCodecDetermines whether two variable argument values are encoded equally.- Specified by:
isEncodedEqualin interfaceVarargCodec<List<T>,T> - Parameters:
x- The first variable argument value.y- The second variable argument value.- Returns:
- true if the two values are encoded equally, false otherwise.
-
encodeVararg
Description copied from interface:VarargCodecEncode a variable argument value into a list of expressions.- Specified by:
encodeVarargin interfaceVarargCodec<List<T>,T> - Parameters:
value- The variable argument value.exprs- The list to which any expressions will be appended.
-
decodeVararg
public List<T> decodeVararg(Deque<ESExpr> exprs, VarargCodec.PositionalPathBuilder pathBuilder) throws DecodeException Description copied from interface:VarargCodecDecode a list of expressions into a variable argument value.- Specified by:
decodeVarargin interfaceVarargCodec<List<T>,T> - Parameters:
exprs- The expressions.pathBuilder- A path builder of the current expressions within the decoded object for diagnostic purposes.- Returns:
- The variable argument value.
- Throws:
DecodeException- when the value cannot be decoded.
-