Package org.assertj.core.data
Class Percentage
- java.lang.Object
-
- org.assertj.core.data.Percentage
-
public final class Percentage extends Object
A positive percentage value.- Author:
- Alexander Bishcof
-
-
Field Summary
Fields Modifier and Type Field Description double
value
-
Constructor Summary
Constructors Modifier Constructor Description private
Percentage(double value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
int
hashCode()
private boolean
noFractionalPart()
String
toString()
static Percentage
withPercentage(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:
NullPointerException
- if the given value isnull
.IllegalArgumentException
- if the given value is negative.
-
noFractionalPart
private boolean noFractionalPart()
-
-