Package org.apache.torque.om

# Klasse ObjectKey<T>

java.lang.Object
org.apache.torque.om.ObjectKey<T>

Alle implementierten Schnittstellen:
  `Serializable`, `Comparable<Object>`

Bekannte direkte Unterklassen:
  `ComboKey`, `SimpleKey`

public abstract class ObjectKey<T> extends Object implements Serializable, Comparable<Object>
This class can be used to uniquely identify an object within an application. There are four subclasses: StringKey, NumberKey, and DateKey, and ComboKey which is a Key made up of a combination of the first three.

Version:
  $Id: ObjectKey.java 1917245 2024-04-21 14:06:23Z tv $
Autor:
  John McNally
Siehe auch:
  - Serialisierte Form

- ## Konstruktorübersicht

  Konstruktoren
  Konstruktor
  Beschreibung
  `ObjectKey()`
  Initializes the internal key value to `null`.

- ## Methodenübersicht

  Modifizierer und Typ
  Methode
  Beschreibung
  `void`
  `appendTo(StringBuilder sb)`
  Appends a String representation of the key to a buffer.
  `int`
  `compareTo(Object obj)`
  Implements the compareTo method.
  `boolean`
  `equals(Object obj)`
  Returns whether this ObjekctKey is equal to another Object.
  `abstract int`
  `getJdbcType()`
  Returns the JDBC type of the key as defined in `java.sql.Types`.
  `T`
  `getValue()`
  Get the underlying object.
  `int`
  `hashCode()`
  Returns the hashcode of the underlying value (key), if key is not null.
  `<O extends ObjectKey<T>>
  void`
  `setValue(O key)`
  Sets the internal representation to the same object used by key.
  `void`
  `setValue(T key)`
  Sets the internal representation.
  `String`
  `toString()`
  Get a String representation of this key.

  ### Von Klasse geerbte Methoden java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Konstruktordetails

  - ### ObjectKey

    public ObjectKey()
    Initializes the internal key value to `null`.

- ## Methodendetails

  - ### hashCode

    public int hashCode()
    Returns the hashcode of the underlying value (key), if key is not null. Otherwise calls Object.hashCode()
    Setzt außer Kraft:
      `hashCode` in Klasse `Object`
    Gibt zurück:
      an `int` value

  - ### equals

    public boolean equals(Object obj)
    Returns whether this ObjekctKey is equal to another Object. obj is equal to this ObjectKey if obj has the same class as this ObjectKey and contains the same information this key contains. Two ObjectKeys that both contain null values are not considered equal.
    Setzt außer Kraft:
      `equals` in Klasse `Object`
    Parameter:
      `obj` - the comparison value.
    Gibt zurück:
      whether the two objects are equal.

  - ### getValue

    public T getValue()
    Get the underlying object.
    Gibt zurück:
      the underlying object

  - ### getJdbcType

    public abstract int getJdbcType()
    Returns the JDBC type of the key as defined in `java.sql.Types`.
    Gibt zurück:
      the JDBC type of the key.

  - ### appendTo

    public void appendTo(StringBuilder sb)
    Appends a String representation of the key to a buffer.
    Parameter:
      `sb` - a `StringBuilder`

  - ### compareTo

    public int compareTo(Object obj)
    Implements the compareTo method.
    Angegeben von:
      `compareTo` in Schnittstelle `Comparable<T>`
    Parameter:
      `obj` - the object to compare to this object
    Gibt zurück:
      a numeric comparison of the two values

  - ### setValue

    public void setValue(T key)
    Sets the internal representation.
    Parameter:
      `key` - the key value

  - ### setValue

    public <O extends ObjectKey<T>> void setValue(O key)
    Sets the internal representation to the same object used by key.
    Typparameter:
      `O` - the key type
    Parameter:
      `key` - the key value

  - ### toString

    public String toString()
    Get a String representation of this key.
    Setzt außer Kraft:
      `toString` in Klasse `Object`
    Gibt zurück:
      a String representation of this key, or an empty String if the value is null.