Class AbstractSimpleIdentity<T extends Serializable>

java.lang.Object
dev.orne.beans.AbstractIdentity
dev.orne.beans.AbstractSimpleIdentity<T>
Type Parameters:
T - The type of the identity value
All Implemented Interfaces:
Identity, Serializable
Direct Known Subclasses:
BigIntegerIdentity, LongIdentity, StringIdentity

@API(status=STABLE, since="0.1") public abstract class AbstractSimpleIdentity<T extends Serializable> extends AbstractIdentity
Abstract implementation for Identity for identities composed of a single inner value.
Since:
0.1
Version:
1.0, 2020-05
Author:
(w) Iker Hernaez
See Also:
  • Constructor Details

    • AbstractSimpleIdentity

      protected AbstractSimpleIdentity(T value)
      Creates a new instance.
      Parameters:
      value - The identity value
    • AbstractSimpleIdentity

      protected AbstractSimpleIdentity(@NotNull @NotNull AbstractSimpleIdentity<T> copy)
      Copy constructor.
      Parameters:
      copy - The instance to copy
  • Method Details

    • getValue

      public T getValue()
      Returns the identity inner value.
      Returns:
      The identity inner value
    • getIdentityTokenBody

      protected String getIdentityTokenBody()
      Returns the identity token body composed from the values of this identity. Equal instances must return equal identity token body.
      Specified by:
      getIdentityTokenBody in class AbstractIdentity
      Returns:
      The identity token body for this instance
    • hashCode

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

      public boolean equals(Object obj)
      Overrides:
      equals in class AbstractIdentity