Class BaseObjectIdentity<PK extends Comparable<PK> & Serializable>

java.lang.Object
net.solarnetwork.central.domain.BaseObjectIdentity<PK>
All Implemented Interfaces:
Serializable, Cloneable, Comparable<PK>, net.solarnetwork.domain.Identity<PK>
Direct Known Subclasses:
BaseObjectEntity

public class BaseObjectIdentity<PK extends Comparable<PK> & Serializable> extends Object implements Cloneable, Serializable, net.solarnetwork.domain.Identity<PK>
Base implementation of Identity using a Comparable, Serializable primary key.
Since:
1.34
See Also:
  • Constructor Details

    • BaseObjectIdentity

      public BaseObjectIdentity()
  • Method Details

    • clone

      public Object clone()
      Overrides:
      clone in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Test if two BaseObjectIdentity objects have the same getId() value.
      Overrides:
      equals in class Object
    • compareTo

      public int compareTo(PK o)
      Compare based on the primary key, with null values ordered before non-null values.
      Specified by:
      compareTo in interface Comparable<PK extends Comparable<PK> & Serializable>
    • getId

      public PK getId()
      Get the primary key.
      Specified by:
      getId in interface net.solarnetwork.domain.Identity<PK extends Comparable<PK> & Serializable>
      Returns:
      the id
    • setId

      public void setId(PK id)
      Set the primary key.
      Parameters:
      id - the id to set