Class DateDecoder

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

    public final class DateDecoder
    extends LeafDecoder<java.util.Date>
    Decode a date.
    • Constructor Summary

      Constructors 
      Constructor Description
      DateDecoder()
      Default date decoder using ISO_DATE_TIME.
      DateDecoder​(java.lang.String formatter)
      Date decode that takes a formatter.
    • Constructor Detail

      • DateDecoder

        public DateDecoder()
        Default date decoder using ISO_DATE_TIME.
      • DateDecoder

        public DateDecoder​(java.lang.String formatter)
        Date decode that takes a formatter.
        Parameters:
        formatter - DateTimeFormatter pattern
    • Method Detail

      • applyConfig

        public void applyConfig​(GestaltConfig config)
        Description copied from interface: Decoder
        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
      • 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<java.util.Date> leafDecode​(java.lang.String path,
                                                       ConfigNode node)
        Description copied from class: LeafDecoder
        Decode a leaf value.
        Specified by:
        leafDecode in class LeafDecoder<java.util.Date>
        Parameters:
        path - the current path.
        node - the current node we are decoding.
        Returns:
        GResultOf the current node with details of either success or failures.