Class OptionalIntDecoder

  • All Implemented Interfaces:
    Decoder<java.util.OptionalInt>

    public final class OptionalIntDecoder
    extends java.lang.Object
    implements Decoder<java.util.OptionalInt>
    Decodes an OptionalInt type.
    • Constructor Detail

      • OptionalIntDecoder

        public OptionalIntDecoder()
    • 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.
        Specified by:
        priority in interface Decoder<java.util.OptionalInt>
        Returns:
        Priority
      • name

        public java.lang.String name()
        Description copied from interface: Decoder
        Name of the encoder.
        Specified by:
        name in interface Decoder<java.util.OptionalInt>
        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.
        Specified by:
        canDecode in interface Decoder<java.util.OptionalInt>
        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
      • decode

        public GResultOf<java.util.OptionalInt> decode​(java.lang.String path,
                                                       Tags tags,
                                                       ConfigNode node,
                                                       TypeCapture<?> type,
                                                       DecoderContext decoderContext)
        Description copied from interface: Decoder
        Decode the current node. If the current node is a class or list we may need to decode sub nodes.
        Specified by:
        decode in interface Decoder<java.util.OptionalInt>
        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 context of the current decoder.
        Returns:
        GResultOf the current node with details of either success or failures.