Skip navigation links
dk.heick.properties.types.utils

Class RangeUtils

    • Constructor Detail

      • RangeUtils

        public RangeUtils()
    • Method Detail

      • validateMinMaxValues

        public static <T extends Comparable<T>> void validateMinMaxValues(String propertyName,
                                                                          Range<T> range,
                                                                          T defaultValue)
                                                                   throws PropertyException
        Validates the range settings called by validateConstraints method in the PropertyType.
        Parameters:
        propertyName - the name of the propertyType.
        range - the Range instance.
        defaultValue - the default value if any.
        Throws:
        PropertyException - if both min and max value has a value (!=null) and minValue is greather than maxValue or if defaultValue is set (!=null) that the defaultValue is outside the range.
        See Also:
        PropertyType.validateConstraints(String)
      • getMinMaxValueDescription

        public static <T extends Comparable<T>> List<String> getMinMaxValueDescription(Range<T> range)
        Genereates range descriptions to be added to string list restrictions.
        Parameters:
        range - the Range instance.
        Returns:
        a description of the range restrictions.
        See Also:
        PropertyType.getRestrictions()