Class RangeRestrictionFactory

    • Field Detail

      • LONG_COMPARATOR

        private static final java.util.Comparator<java.lang.Object> LONG_COMPARATOR
      • INTEGER_COMPARATOR

        private static final java.util.Comparator<java.lang.Object> INTEGER_COMPARATOR
      • SHORT_COMPARATOR

        private static final java.util.Comparator<java.lang.Object> SHORT_COMPARATOR
      • BYTE_COMPARATOR

        private static final java.util.Comparator<java.lang.Object> BYTE_COMPARATOR
      • DOUBLE_COMPARATOR

        private static final java.util.Comparator<java.lang.Object> DOUBLE_COMPARATOR
      • FLOAT_COMPARATOR

        private static final java.util.Comparator<java.lang.Object> FLOAT_COMPARATOR
    • Constructor Detail

      • RangeRestrictionFactory

        public RangeRestrictionFactory()
    • Method Detail

      • createOptionRestriction

        public final OptionRestriction createOptionRestriction​(java.lang.annotation.Annotation annotation)
        Description copied from interface: OptionRestrictionFactory
        Try and create an option restriction from the given annotation
        Specified by:
        createOptionRestriction in interface OptionRestrictionFactory
        Parameters:
        annotation - Annotation
        Returns:
        Option restriction or null if this factory cannot create a restriction from the given annotation
      • createCommon

        protected final AbstractCommonRestriction createCommon​(java.lang.annotation.Annotation annotation)
        Handles converting all the basic range annotations into appropriate range restrictions
        Parameters:
        annotation - Annotation to create range from
        Returns:
        Range restriction
      • createUnknownRange

        protected AbstractCommonRestriction createUnknownRange​(java.lang.annotation.Annotation annotation)
        Handles turning unknown annotations into range restrictions, derived factories can extend this to add support for additional range restrictions
        Parameters:
        annotation - Annotation to create range from
        Returns:
        Range restriction or null if not a supported annotation
      • createLexicalRange

        protected RangeRestriction createLexicalRange​(java.lang.annotation.Annotation annotation)
      • createFloatRange

        protected RangeRestriction createFloatRange​(java.lang.annotation.Annotation annotation)
      • createDoubleRange

        protected RangeRestriction createDoubleRange​(java.lang.annotation.Annotation annotation)
      • createByteRange

        protected RangeRestriction createByteRange​(java.lang.annotation.Annotation annotation)
      • createShortRange

        protected RangeRestriction createShortRange​(java.lang.annotation.Annotation annotation)
      • createIntegerRange

        protected RangeRestriction createIntegerRange​(java.lang.annotation.Annotation annotation)
      • createLongRange

        protected RangeRestriction createLongRange​(java.lang.annotation.Annotation annotation)
      • supportedAnnotations

        protected java.util.List<java.lang.Class<? extends java.lang.annotation.Annotation>> supportedAnnotations()
      • supportedArgumentsAnnotations

        public java.util.List<java.lang.Class<? extends java.lang.annotation.Annotation>> supportedArgumentsAnnotations()
        Description copied from interface: ArgumentsRestrictionFactory
        Gets a list of annotations that this factory can convert into arguments restrictions
        Specified by:
        supportedArgumentsAnnotations in interface ArgumentsRestrictionFactory
        Returns:
        List of supported annotations
      • supportedOptionAnnotations

        public java.util.List<java.lang.Class<? extends java.lang.annotation.Annotation>> supportedOptionAnnotations()
        Description copied from interface: OptionRestrictionFactory
        Gets a list of annotations that this factory can convert into option restrictions
        Specified by:
        supportedOptionAnnotations in interface OptionRestrictionFactory
        Returns:
        List of supported annotations