Class FacetRangeGenerator<T extends Comparable<T>>

    • Constructor Detail

      • FacetRangeGenerator

        public FacetRangeGenerator​(RangeFacet rangeFacet)
    • Method Detail

      • formatValue

        public String formatValue​(T val)
        Formats a Range endpoint for use as a range label name in the response. Default Impl just uses toString()
      • getValue

        public final T getValue​(String rawval)
        Parses a String param into an Range endpoint value throwing a useful exception if not possible
      • parseVal

        protected abstract T parseVal​(String rawval)
                               throws ParseException
        Parses a String param into an Range endpoint. Can throw a low level format exception as needed.
        Throws:
        ParseException
      • getGap

        public final Object getGap​(String gap)
        Parses a String param into a value that represents the gap and can be included in the response, throwing a useful exception if not possible.

        Note: uses Object as the return type instead of T for things like Date where gap is just a DateMathParser string

      • parseGap

        protected Object parseGap​(String rawval)
                           throws ParseException
        Parses a String param into a value that represents the gap and can be included in the response. Can throw a low level format exception as needed.

        Default Impl calls parseVal

        Throws:
        ParseException
      • addGap

        public final T addGap​(T value,
                              String gap)
        Adds the String gap param to a low Range endpoint value to determine the corrisponding high Range endpoint value, throwing a useful exception if not possible.
      • parseAndAddGap

        protected abstract T parseAndAddGap​(T value,
                                            String gap)
                                     throws ParseException
        Adds the String gap param to a low Range endpoint value to determine the corrisponding high Range endpoint value. Can throw a low level format exception as needed.
        Throws:
        ParseException