Class NumberRange

    • Constructor Detail

      • NumberRange

        public NumberRange()
        Create a new empty number range
      • NumberRange

        public NumberRange​(BigDecimal from,
                           BigDecimal to)
        Create a new number range
        Parameters:
        from - The start of the number range
        to - The end of the number range
      • NumberRange

        public NumberRange​(String from,
                           String to)
        Create a new number range
        Parameters:
        from - The start of the number range
        to - The end of the number range
      • NumberRange

        public NumberRange​(Integer from,
                           Integer to)
        Create a new number range
        Parameters:
        from - The start of the number range
        to - The end of the number range
      • NumberRange

        public NumberRange​(Long from,
                           Long to)
        Create a new number range
        Parameters:
        from - The start of the number range
        to - The end of the number range
      • NumberRange

        public NumberRange​(Float from,
                           Float to)
        Create a new number range
        Parameters:
        from - The start of the number range
        to - The end of the number range
      • NumberRange

        public NumberRange​(Double from,
                           Double to)
        Create a new number range
        Parameters:
        from - The start of the number range
        to - The end of the number range
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getFrom

        public BigDecimal getFrom()
        Inclusive lower bound of the range. Is required if to is not given.
        Specified by:
        getFrom in interface Range<BigDecimal>
        Returns:
        the lower bound
      • getTo

        public BigDecimal getTo()
        Exclusive upper bound of the range. Is required if from is not given.
        Specified by:
        getTo in interface Range<BigDecimal>
        Returns:
        the upper bound
      • getName

        public String getName()
        Name given to the range
        Returns:
        the range name
      • setFrom

        public NumberRange setFrom​(BigDecimal from)
        Inclusive lower bound of the range. Is required if to is not given.
        Parameters:
        from - the lower bound
        Returns:
        this.
      • setTo

        public NumberRange setTo​(BigDecimal to)
        Exclusive upper bound of the range. Is required if from is not given.
        Parameters:
        to - the upper bound
        Returns:
        this.
      • setName

        public NumberRange setName​(String name)
        Name given to the range
        Parameters:
        name - the range name
        Returns:
        this.