java.lang.Object
dev.argon.esexpr.codecs.ListVarargCodec<T>
- Type Parameters:
T- The element type.
- All Implemented Interfaces:
VarargCodec<List<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(List<ESExpr> exprs, @NotNull VarargCodec.PositionalPathBuilder pathBuilder) Decode a list of expressions into a variable argument value.encodeVararg(List<T> value) Encode a variable argument value into a list of expressions.
-
Constructor Details
-
ListVarargCodec
Creates a VarArgCodec for List values.- Parameters:
elementCodec- A value codec for the element type.
-
-
Method Details
-
encodeVararg
Description copied from interface:VarargCodecEncode a variable argument value into a list of expressions.- Specified by:
encodeVarargin interfaceVarargCodec<T>- Parameters:
value- The variable argument value.- Returns:
- The expressions.
-
decodeVararg
public List<T> decodeVararg(List<ESExpr> exprs, @NotNull @NotNull VarargCodec.PositionalPathBuilder pathBuilder) throws DecodeException Description copied from interface:VarargCodecDecode a list of expressions into a variable argument value.- Specified by:
decodeVarargin interfaceVarargCodec<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.
-