Package org.apache.guacamole.net.auth
Class AbstractIdentifiable
java.lang.Object
org.apache.guacamole.net.auth.AbstractIdentifiable
- All Implemented Interfaces:
Identifiable
- Direct Known Subclasses:
AbstractActiveConnection
,AbstractAuthenticatedUser
,AbstractConnection
,AbstractConnectionGroup
,AbstractUser
,AbstractUserGroup
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 Summary
ConstructorsConstructorDescriptionCreates a new AbstractIdentifiable that compares identifiers in a case-sensitive manner.AbstractIdentifiable
(boolean caseSensitive) Creates a new AbstractIdentifiable that compares identifiers according to the provided case sensitivity flag. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the unique identifier assigned to this object.int
hashCode()
void
setIdentifier
(String identifier) Sets the identifier assigned to this object.
-
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 usingCaseSensitivity.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 invokingAbstractIdentifiable(boolean)
with the case sensitivity flag set to true.
-
-
Method Details
-
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 interfaceIdentifiable
- Returns:
- The unique identifier assigned to this object, which may not be null.
-
setIdentifier
Description copied from interface:Identifiable
Sets the identifier assigned to this object.- Specified by:
setIdentifier
in interfaceIdentifiable
- Parameters:
identifier
- The identifier to assign.
-
hashCode
public int hashCode() -
equals
-