Package org.assertj.core.data
Class Percentage
- java.lang.Object
-
- org.assertj.core.data.Percentage
-
public final class Percentage extends java.lang.ObjectA positive percentage value.
-
-
Field Summary
Fields Modifier and Type Field Description doublevalue
-
Constructor Summary
Constructors Modifier Constructor Description privatePercentage(double value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)inthashCode()private booleannoFractionalPart()java.lang.StringtoString()static PercentagewithPercentage(double value)Creates a newPercentage.
-
-
-
Method Detail
-
withPercentage
public static Percentage withPercentage(double value)
Creates a newPercentage.- Parameters:
value- the value of the percentage.- Returns:
- the created
Percentage. - Throws:
java.lang.NullPointerException- if the given value isnull.java.lang.IllegalArgumentException- if the given value is negative.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
noFractionalPart
private boolean noFractionalPart()
-
-