Interface Decoder<T>

    • Method Detail

      • priority

        Priority priority()
        Priority for the decoder. Allows us to sort encoders when we have multiple matches.
        Returns:
        Priority
      • name

        java.lang.String name()
        Name of the encoder.
        Returns:
        encoder name
      • applyConfig

        default void applyConfig​(GestaltConfig config)
        Apply the GestaltConfig to the Decoder. Needed when building via the ServiceLoader It is a default method as most Decoders don't need to apply configs.
        Parameters:
        config - GestaltConfig to update the ConfigLoader
      • canDecode

        boolean canDecode​(java.lang.String path,
                          Tags tags,
                          ConfigNode node,
                          TypeCapture<?> type)
        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
      • decode

        GResultOf<T> decode​(java.lang.String path,
                            Tags tags,
                            ConfigNode node,
                            TypeCapture<?> type,
                            DecoderContext decoderContext)
        Decode the current node. If the current node is a class or list we may need to decode sub nodes.
        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.