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 intCompares thisObjectto a givenObject.final booleanTests for equality.final booleangreaterThan(long value) Compares thisLongValuewith a primitivelongvalue.final booleangreaterThan(LongValue that) Compares thisLongValuewith anotherLongValue.final booleangreaterThanOrEqual(long value) Compares thisLongValuewith a primitivelongvalue.final booleangreaterThanOrEqual(LongValue that) Compares thisLongValuewith anotherLongValue.final inthashCode()Returns the hash code for thisObject.final booleanlessThan(long that) Compares thisLongValuewith a primitivelongvalue.final booleanCompares thisLongValuewith anotherLongValue.final booleanlessThanOrEqual(long that) Compares thisLongValuewith a primitivelongvalue.final booleanlessThanOrEqual(LongValue that) Compares thisLongValuewith 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 thisLongValueto aString.
-
Field Details
-
value
thelongvalue
-
-
Constructor Details
-
LongValue
Constructor.- Parameters:
value- thelongvalue
-
-
Method Details
-
compareTo
Compares thisObjectto a givenObject.- Specified by:
compareToin interfaceComparable<LongValue>- Parameters:
that- theObjectto 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 thisLongValuewith a primitivelongvalue.- Parameters:
value- thelongvalue to compare with- Returns:
trueif thisLongValueis greater than the givenlongvalue
-
greaterThanOrEqual
Compares thisLongValuewith a primitivelongvalue.- Parameters:
value- thelongvalue to compare with- Returns:
trueif thisLongValueis greater than or equal to the givenlongvalue
-
greaterThan
Compares thisLongValuewith anotherLongValue.- Parameters:
that- theLongValueto compare with- Returns:
trueif thisLongValueis greater than the givenLongValue
-
greaterThanOrEqual
Compares thisLongValuewith anotherLongValue.- Parameters:
that- theLongValueto compare with- Returns:
trueif thisLongValueis greater than or equal to the givenLongValue
-
hashCode
Returns the hash code for thisObject. -
lessThan
Compares thisLongValuewith a primitivelongvalue.- Parameters:
that- thelongvalue to compare with- Returns:
trueif thisLongValueis less than the givenlongvalue
-
lessThanOrEqual
Compares thisLongValuewith a primitivelongvalue.- Parameters:
that- thelongvalue to compare with- Returns:
trueif thisLongValueis less than or equal to the givenlongvalue
-
lessThan
Compares thisLongValuewith anotherLongValue.- Parameters:
that- theLongValuevalue to compare with- Returns:
trueif thisLongValueis less than the givenLongValue
-
lessThanOrEqual
Compares thisLongValuewith anotherLongValue.- Parameters:
that- theLongValuevalue to compare with- Returns:
trueif thisLongValueis less than or equal to the givenLongValue
-
toString
Converts thisLongValueto 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
nullif they are both null
-