Package org.apache.wicket.util.value
Class LongValue
java.lang.Object
org.apache.wicket.util.value.LongValue
- All Implemented Interfaces:
Serializable
,Comparable<LongValue>
- Direct Known Subclasses:
Bytes
A base class based on the Java
long
primitive for value classes that want to
implement standard operations on that value without the pain of aggregating a Long
object.- Since:
- 1.2.6
- Author:
- Jonathan Locke
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal int
Compares thisObject
to a givenObject
.final boolean
Tests for equality.final boolean
greaterThan
(long value) Compares thisLongValue
with a primitivelong
value.final boolean
greaterThan
(LongValue that) Compares thisLongValue
with anotherLongValue
.final boolean
greaterThanOrEqual
(long value) Compares thisLongValue
with a primitivelong
value.final boolean
greaterThanOrEqual
(LongValue that) Compares thisLongValue
with anotherLongValue
.final int
hashCode()
Returns the hash code for thisObject
.final boolean
lessThan
(long that) Compares thisLongValue
with a primitivelong
value.final boolean
Compares thisLongValue
with anotherLongValue
.final boolean
lessThanOrEqual
(long that) Compares thisLongValue
with a primitivelong
value.final boolean
lessThanOrEqual
(LongValue that) Compares thisLongValue
with anotherLongValue
.static <T extends LongValue>
Tmax
(T lhs, T rhs) Returns the max of the two long values.static <T extends LongValue>
TmaxNullSafe
(T lhs, T rhs) Null-safe version ofmax(T, T)
.static <T extends LongValue>
Tmin
(T lhs, T rhs) Returns the min of the two long values.toString()
Converts thisLongValue
to aString
.
-
Field Details
-
value
thelong
value
-
-
Constructor Details
-
LongValue
Constructor.- Parameters:
value
- thelong
value
-
-
Method Details
-
compareTo
Compares thisObject
to a givenObject
.- Specified by:
compareTo
in interfaceComparable<LongValue>
- Parameters:
that
- theObject
to compare with- Returns:
- 0 if equal, -1 if less than the given
Object
's value, or 1 if greater than givenObject
's value
-
equals
Tests for equality. -
greaterThan
Compares thisLongValue
with a primitivelong
value.- Parameters:
value
- thelong
value to compare with- Returns:
true
if thisLongValue
is greater than the givenlong
value
-
greaterThanOrEqual
Compares thisLongValue
with a primitivelong
value.- Parameters:
value
- thelong
value to compare with- Returns:
true
if thisLongValue
is greater than or equal to the givenlong
value
-
greaterThan
Compares thisLongValue
with anotherLongValue
.- Parameters:
that
- theLongValue
to compare with- Returns:
true
if thisLongValue
is greater than the givenLongValue
-
greaterThanOrEqual
Compares thisLongValue
with anotherLongValue
.- Parameters:
that
- theLongValue
to compare with- Returns:
true
if thisLongValue
is greater than or equal to the givenLongValue
-
hashCode
Returns the hash code for thisObject
. -
lessThan
Compares thisLongValue
with a primitivelong
value.- Parameters:
that
- thelong
value to compare with- Returns:
true
if thisLongValue
is less than the givenlong
value
-
lessThanOrEqual
Compares thisLongValue
with a primitivelong
value.- Parameters:
that
- thelong
value to compare with- Returns:
true
if thisLongValue
is less than or equal to the givenlong
value
-
lessThan
Compares thisLongValue
with anotherLongValue
.- Parameters:
that
- theLongValue
value to compare with- Returns:
true
if thisLongValue
is less than the givenLongValue
-
lessThanOrEqual
Compares thisLongValue
with anotherLongValue
.- Parameters:
that
- theLongValue
value to compare with- Returns:
true
if thisLongValue
is less than or equal to the givenLongValue
-
toString
Converts thisLongValue
to aString
. -
min
Returns the min of the two long values.- Type Parameters:
T
-- Parameters:
lhs
-rhs
-- Returns:
- min value
- Throws:
IllegalArgumentException
- if either argument isnull
-
max
Returns the max of the two long values.- Type Parameters:
T
-- Parameters:
lhs
-rhs
-- Returns:
- max value
- Throws:
IllegalArgumentException
- if either argument isnull
-
maxNullSafe
Null-safe version ofmax(T, T)
. Nulls are considered less then any concrete value.- Type Parameters:
T
-- Parameters:
lhs
-rhs
-- Returns:
- max of two values or
null
if they are both null
-