Module org.github.gestalt.core
Class CollectionDecoder<T extends java.util.Collection<?>>
- java.lang.Object
-
- org.github.gestalt.config.decoder.CollectionDecoder<T>
-
- Type Parameters:
T- generic type of the collection
- All Implemented Interfaces:
Decoder<T>
- Direct Known Subclasses:
ListDecoder,SequencedCollectionDecoder,SequencedSetDecoder,SetDecoder
public abstract class CollectionDecoder<T extends java.util.Collection<?>> extends java.lang.Object implements Decoder<T>
Base class for decoding collections. Will handle validation of the node type.
-
-
Constructor Summary
Constructors Constructor Description CollectionDecoder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract GResultOf<T>arrayDecode(java.lang.String path, Tags tags, ConfigNode node, TypeCapture<?> klass, DecoderContext decoderContext)Decode an array values.GResultOf<T>decode(java.lang.String path, Tags tags, ConfigNode node, TypeCapture<?> type, DecoderContext decoderContext)Decode the current node.Prioritypriority()Priority for the decoder.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.github.gestalt.config.decoder.Decoder
applyConfig, canDecode, name
-
-
-
-
Method Detail
-
priority
public Priority priority()
Description copied from interface:DecoderPriority for the decoder. Allows us to sort encoders when we have multiple matches.
-
decode
public GResultOf<T> decode(java.lang.String path, Tags tags, ConfigNode node, TypeCapture<?> type, DecoderContext decoderContext)
Description copied from interface:DecoderDecode the current node. If the current node is a class or list we may need to decode sub nodes.- Specified by:
decodein interfaceDecoder<T extends java.util.Collection<?>>- Parameters:
path- the current pathtags- the tags for the current requestnode- the current node we are decoding.type- the type of object we are decoding.decoderContext- The context of the current decoder.- Returns:
- GResultOf the current node with details of either success or failures.
-
arrayDecode
protected abstract GResultOf<T> arrayDecode(java.lang.String path, Tags tags, ConfigNode node, TypeCapture<?> klass, DecoderContext decoderContext)
Decode an array values.- Parameters:
path- Current path we are decodingtags- Current tags for the requestnode- current node we are decodingklass- class to decode intodecoderContext- The context of the current decoder.- Returns:
- GResultOf array built from the config node
-
-