Class Percentage


  • public final class Percentage
    extends java.lang.Object
    A positive percentage value.
    • Field Detail

      • value

        public final double value
    • Constructor Detail

      • Percentage

        private Percentage​(double value)
    • Method Detail

      • withPercentage

        public static Percentage withPercentage​(double value)
        Creates a new Percentage.
        Parameters:
        value - the value of the percentage.
        Returns:
        the created Percentage.
        Throws:
        java.lang.NullPointerException - if the given value is null.
        java.lang.IllegalArgumentException - if the given value is negative.
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • noFractionalPart

        private boolean noFractionalPart()