Package org.assertj.core.data
Class Percentage
- java.lang.Object
-
- org.assertj.core.data.Percentage
-
public final class Percentage extends java.lang.Object
A positive percentage value.
-
-
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(java.lang.Object obj)
int
hashCode()
private boolean
noFractionalPart()
java.lang.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:
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:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
noFractionalPart
private boolean noFractionalPart()
-
-