- java.lang.Object
-
- org.github.gestalt.config.decoder.LeafDecoder<T>
-
- Type Parameters:
T- generic type for this leaf decoder
- All Implemented Interfaces:
Decoder<T>
- Direct Known Subclasses:
BigDecimalDecoder,BigIntegerDecoder,BooleanDecoder,ByteDecoder,CharDecoder,DateDecoder,DoubleDecoder,DurationDecoder,EnumDecoder,FileDecoder,FloatDecoder,InstantDecoder,IntegerDecoder,LocalDateDecoder,LocalDateTimeDecoder,LongDecoder,PathDecoder,PatternDecoder,ShortDecoder,StringDecoder,UUIDDecoder
public abstract class LeafDecoder<T> extends java.lang.Object implements Decoder<T>
Base class for leaf decoders. Will decode leaf types, including booleans, integers ect.
-
-
Constructor Summary
Constructors Constructor Description LeafDecoder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description GResultOf<T>decode(java.lang.String path, Tags tags, ConfigNode node, TypeCapture<?> type, DecoderContext decoderContext)Validates that the current node is a leaf and if it is call leafDecode.protected abstract GResultOf<T>leafDecode(java.lang.String path, ConfigNode node)Decode a leaf value.protected GResultOf<T>leafDecode(java.lang.String path, ConfigNode node, TypeCapture<?> type)Decode a leaf value.-
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, priority
-
-
-
-
Method Detail
-
decode
public GResultOf<T> decode(java.lang.String path, Tags tags, ConfigNode node, TypeCapture<?> type, DecoderContext decoderContext)
Validates that the current node is a leaf and if it is call leafDecode.- Specified by:
decodein interfaceDecoder<T>- Parameters:
path- the current path.tags- the tags for the current request.node- the current node we are decoding.type- the type of object we are decoding.decoderContext- the information needed to decode an object.- Returns:
- GResultOf the current node with details of either success or failures.
-
leafDecode
protected GResultOf<T> leafDecode(java.lang.String path, ConfigNode node, TypeCapture<?> type)
Decode a leaf value.- Parameters:
path- the current path.node- the current node we are decoding.type- the type of object we are decoding.- Returns:
- GResultOf the current node with details of either success or failures.
-
leafDecode
protected abstract GResultOf<T> leafDecode(java.lang.String path, ConfigNode node)
Decode a leaf value.- Parameters:
path- the current path.node- the current node we are decoding.- Returns:
- GResultOf the current node with details of either success or failures.
-
-