Class AbstractIdentifiable

java.lang.Object
org.apache.guacamole.net.auth.AbstractIdentifiable
All Implemented Interfaces:
Identifiable
Direct Known Subclasses:
AbstractActiveConnection, AbstractAuthenticatedUser, AbstractConnection, AbstractConnectionGroup, AbstractUser, AbstractUserGroup

public abstract class AbstractIdentifiable extends Object implements Identifiable
Abstract implementation of Identifiable which provides equals() and hashCode() implementations which use the identifier to determine equality. The identifier comparison is case-sensitive unless configured otherwise via the AbstractIdentifiable(boolean) constructor. If using case-insensitive identifiers, any identifiers that are retrieved from or assigned to this object will first be canonicalized to a case-insensitive form using CaseSensitivity.canonicalize(java.lang.String, boolean).
  • Constructor Details

    • AbstractIdentifiable

      public AbstractIdentifiable(boolean caseSensitive)
      Creates a new AbstractIdentifiable that compares identifiers according to the provided case sensitivity flag. If using case-insensitive identifiers, any identifiers that are retrieved from or assigned to this object will first be canonicalized to a case-insensitive form using CaseSensitivity.canonicalize(java.lang.String, boolean).
      Parameters:
      caseSensitive - true if identifiers should be compared in a case-sensitive manner, false otherwise.
    • AbstractIdentifiable

      public AbstractIdentifiable()
      Creates a new AbstractIdentifiable that compares identifiers in a case-sensitive manner. This is equivalent to invoking AbstractIdentifiable(boolean) with the case sensitivity flag set to true.
  • Method Details

    • getIdentifier

      public String getIdentifier()
      Description copied from interface: Identifiable
      Returns the unique identifier assigned to this object. All identifiable objects must have a deterministic, unique identifier which may not be null.
      Specified by:
      getIdentifier in interface Identifiable
      Returns:
      The unique identifier assigned to this object, which may not be null.
    • setIdentifier

      public void setIdentifier(String identifier)
      Description copied from interface: Identifiable
      Sets the identifier assigned to this object.
      Specified by:
      setIdentifier in interface Identifiable
      Parameters:
      identifier - The identifier to assign.
    • hashCode

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

      public boolean equals(Object other)
      Overrides:
      equals in class Object