Class PercentType

    • Constructor Detail

      • PercentType

        public PercentType()
        Creates a new PercentType with 0 as value.
      • PercentType

        public PercentType​(int value)
        Creates a new PercentType with the given value.
        Parameters:
        value - the value representing a percentage
        Throws:
        IllegalArgumentException - when the value is not between 0 and 100
      • PercentType

        public PercentType​(String value)
        Creates a new PercentType with the given value. The English locale is used to determine (decimal/grouping) separator characters.
        Parameters:
        value - the non null value representing a percentage
        Throws:
        NumberFormatException - when the number could not be parsed to a BigDecimal
        IllegalArgumentException - when the value is not between 0 and 100
      • PercentType

        public PercentType​(String value,
                           Locale locale)
        Creates a new PercentType with the given value.
        Parameters:
        value - the non null value representing a percentage
        locale - the locale used to determine (decimal/grouping) separator characters
        Throws:
        NumberFormatException - when the number could not be parsed to a BigDecimal
        IllegalArgumentException - when the value is not between 0 and 100
      • PercentType

        public PercentType​(BigDecimal value)
        Creates a new PercentType with the given value.
        Parameters:
        value - the value representing a percentage.
        Throws:
        IllegalArgumentException - when the value is not between 0 and 100