Class IntValue

java.lang.Object
org.apache.wicket.util.value.IntValue
All Implemented Interfaces:
Serializable, Comparable<IntValue>

public class IntValue extends Object implements Comparable<IntValue>, Serializable
A base class based on the Java int primitive for value classes that want to implement standard operations on that value without the pain of aggregating an Integer object.
Since:
1.2.6
Author:
Jonathan Locke
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final int
    the int value
  • Constructor Summary

    Constructors
    Constructor
    Description
    IntValue(int value)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    final int
     
    final boolean
    equals(Object that)
    Compares this Object to a given Object.
    final boolean
    greaterThan(int value)
    Compares this IntValue with a primitive int value.
    final boolean
    Compares this IntValue with another IntValue.
    final int
    Returns the hash code for this Object.
    final boolean
    lessThan(int that)
    Compares this IntValue with a primitive int value.
    final boolean
    Compares this IntValue with another IntValue.
    Converts this LongValue to a String.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • value

      protected final int value
      the int value
  • Constructor Details

    • IntValue

      public IntValue(int value)
      Constructor.
      Parameters:
      value - the int value
  • Method Details

    • compareTo

      public final int compareTo(IntValue that)
      Specified by:
      compareTo in interface Comparable<IntValue>
      Parameters:
      that - The object to compare with
      Returns:
      0 if equal, -1 if less than or 1 if greater than
    • equals

      public final boolean equals(Object that)
      Compares this Object to a given Object.
      Overrides:
      equals in class Object
      Parameters:
      that - the Object to compare with
      Returns:
      0 if equal, -1 if less than the given Object's value, or 1 if greater than given Object's value
    • greaterThan

      public final boolean greaterThan(int value)
      Compares this IntValue with a primitive int value.
      Parameters:
      value - the int value to compare with
      Returns:
      true if this IntValue is greater than the given int value
    • greaterThan

      public final boolean greaterThan(IntValue that)
      Compares this IntValue with another IntValue.
      Parameters:
      that - the IntValue to compare with
      Returns:
      true if this IntValue is greater than the given IntValue
    • hashCode

      public final int hashCode()
      Returns the hash code for this Object.
      Overrides:
      hashCode in class Object
      Returns:
      hash code for this Object
    • lessThan

      public final boolean lessThan(int that)
      Compares this IntValue with a primitive int value.
      Parameters:
      that - the int value to compare with
      Returns:
      true if this IntValue is less than the given int value
    • lessThan

      public final boolean lessThan(IntValue that)
      Compares this IntValue with another IntValue.
      Parameters:
      that - the IntValue to compare with
      Returns:
      true if this IntValue is less than the given IntValue
    • toString

      public String toString()
      Converts this LongValue to a String.
      Overrides:
      toString in class Object
      Returns:
      a String representation of this LongValue