|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jcoderz.commons.test.RestrictedLong
public final class RestrictedLong
Holds the RestrictedLong.
long[15..255].Instances of this class are immutable.
This class implements the Comparable interface based on the numeric order of its instances.
| Field Summary | |
|---|---|
static long |
MAX_VALUE
The maximum value of a RestrictedLong (255). |
static long |
MIN_VALUE
The minimum value of a RestrictedLong (15). |
static String |
TYPE_NAME
RestrictedLong - the name of this type as string constant. |
| Method Summary | |
|---|---|
int |
compareTo(Object o)
Compares this RestrictedLong with an other. |
boolean |
equals(Object obj)
|
static RestrictedLong |
fromLong(long id)
Construct a RestrictedLong object from its long representation. |
static RestrictedLong |
fromLong(Long id)
Construct a RestrictedLong object from its Long representation. |
static RestrictedLong |
fromString(String s)
Construct a RestrictedLong object from its string representation. |
int |
hashCode()
|
static RestrictedLong |
random()
Generates a random RestrictedLong object. |
long |
toLong()
Returns the long representation of this RestrictedLong object. |
Long |
toLongObject()
Returns the Long representation of this RestrictedLong object. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String TYPE_NAME
public static final long MIN_VALUE
public static final long MAX_VALUE
| Method Detail |
|---|
public static RestrictedLong fromLong(long id)
throws ArgumentMalformedException
id - the long representation of the RestrictedLong
ArgumentMalformedException - If the given long id
violates the restriction of the type
RestrictedLong.
ArgumentMinValueViolationException - If the value of the given
long id is below MIN_VALUE.
ArgumentMaxValueViolationException - If the value of the given
long id is above MAX_VALUE.
public static RestrictedLong fromString(String s)
throws ArgumentMalformedException
s - the string representation of the RestrictedLong
ArgumentMalformedException - If the given string s
violates the restriction of the type
RestrictedLong.
ArgumentMinValueViolationException - If the value of the given
long id is below MIN_VALUE.
ArgumentMaxValueViolationException - If the value of the given
long id is above MAX_VALUE.
public static RestrictedLong fromLong(Long id)
throws ArgumentMalformedException
id - the Long representation of the RestrictedLong
ArgumentMalformedException - If the given Long id
is null or violates the restriction of the type
RestrictedLong.
ArgumentMinValueViolationException - If the value of the given
long id is below MIN_VALUE.
ArgumentMaxValueViolationException - If the value of the given
long id is above MAX_VALUE.public static RestrictedLong random()
public long toLong()
toLong in interface RestrictedLongpublic Long toLongObject()
toLongObject in interface RestrictedLongpublic String toString()
toString in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic int compareTo(Object o)
compareTo in interface ComparableClassCastException - if the specified object's type prevents
it from being compared to this Object.Long.compareTo(Object)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||