Class EnumDecoder<T extends java.lang.Enum<T>>

  • All Implemented Interfaces:
    Decoder<T>

    public final class EnumDecoder<T extends java.lang.Enum<T>>
    extends LeafDecoder<T>
    Decode an Enum.
    • Constructor Detail

      • EnumDecoder

        public EnumDecoder()
    • Method Detail

      • priority

        public Priority priority()
        Description copied from interface: Decoder
        Priority for the decoder. Allows us to sort encoders when we have multiple matches.
        Returns:
        Priority
      • name

        public java.lang.String name()
        Description copied from interface: Decoder
        Name of the encoder.
        Returns:
        encoder name
      • canDecode

        public boolean canDecode​(java.lang.String path,
                                 Tags tags,
                                 ConfigNode node,
                                 TypeCapture<?> type)
        Description copied from interface: Decoder
        true if this decoder matches the type capture.
        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.
        Returns:
        true if this decoder matches the type capture
      • leafDecode

        protected GResultOf<T> leafDecode​(java.lang.String path,
                                          ConfigNode node,
                                          TypeCapture<?> type)
        Description copied from class: LeafDecoder
        Decode a leaf value.
        Overrides:
        leafDecode in class LeafDecoder<T extends java.lang.Enum<T>>
        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 GResultOf<T> leafDecode​(java.lang.String path,
                                          ConfigNode node)
        Description copied from class: LeafDecoder
        Decode a leaf value.
        Specified by:
        leafDecode in class LeafDecoder<T extends java.lang.Enum<T>>
        Parameters:
        path - the current path.
        node - the current node we are decoding.
        Returns:
        GResultOf the current node with details of either success or failures.