Class Identifier

java.lang.Object
com.codename1.orm.session.Identifier

public final class Identifier extends Object
Immutable composite identity, in the model's declared identifier-field order.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(Object other)
    Compares normalized components in identifier-field order.
    int
    Computes a hash from the normalized key components.
    static Identifier
    of(Object... values)
    Creates a composite identifier, normalizing scalar storage representations.
    Returns a copy of the normalized key component array.

    Methods inherited from class Object

    clone, getClass, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • of

      public static Identifier of(Object... values)
      Creates a composite identifier, normalizing scalar storage representations. Integral byte, short, and int values compare as longs. Copies the supplied array; components should be immutable. Binary components are unsupported.
      Parameters:
      values - key components in declared identifier-field order
      Returns:
      composite identifier for session lookup
      Throws:
      IllegalArgumentException - if a component is binary
    • values

      public Object[] values()
      Returns a copy of the normalized key component array.
      Returns:
      components in identifier-field order
    • equals

      public boolean equals(Object other)
      Compares normalized components in identifier-field order.
      Overrides:
      equals in class Object
      Parameters:
      other - object to compare
      Returns:
      true if the other identifier has equal components
    • hashCode

      public int hashCode()
      Computes a hash from the normalized key components.
      Overrides:
      hashCode in class Object
      Returns:
      component-based hash code