@Embeddable
public class IntegerRange
extends java.lang.Object
implements java.lang.Cloneable
| Constructor and Description |
|---|
IntegerRange() |
IntegerRange(java.lang.Integer min,
java.lang.Integer max) |
| Modifier and Type | Method and Description |
|---|---|
static IntegerRange |
between(int min,
int max)
Returns a range from min to max
|
IntegerRange |
clone() |
boolean |
equals(java.lang.Object obj) |
static IntegerRange |
fixed(int length)
Returns a range from and to the parameter
|
static IntegerRange |
from(int min)
Returns a range from min with no max
|
java.lang.Integer |
getMax()
Return a validation error if the number is out of range, or null if ok
|
java.lang.Integer |
getMin() |
int |
hashCode() |
boolean |
inRange(int number)
Check if the given number is in range
|
void |
setMax(java.lang.Integer max) |
void |
setMin(java.lang.Integer min) |
static IntegerRange |
to(int max)
Returns a range from to max with no min
|
java.lang.String |
toString() |
public IntegerRange()
public IntegerRange(java.lang.Integer min,
java.lang.Integer max)
public static IntegerRange between(int min, int max)
public static IntegerRange fixed(int length)
public static IntegerRange from(int min)
public static IntegerRange to(int max)
public IntegerRange clone()
clone in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.Integer getMax()
public java.lang.Integer getMin()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean inRange(int number)
public void setMax(java.lang.Integer max)
public void setMin(java.lang.Integer min)
public java.lang.String toString()
toString in class java.lang.Object