public abstract class AbstractIdentifiable extends java.lang.Object implements Identifiable
Identifiable. This class simply takes in a
UUID as an ID and provides equality and string representation methods.| Modifier and Type | Field and Description |
|---|---|
protected java.util.UUID |
id
Unique ID.
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractIdentifiable()
Creates a new instance of AbstractIdentifiable with a random ID.
|
protected |
AbstractIdentifiable(java.util.UUID id)
Creates a new instance of AbstractIdentifiable with the supplied ID.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
java.util.UUID |
getID()
Gets the unique identifier.
|
int |
hashCode() |
java.lang.String |
toString() |
protected AbstractIdentifiable()
UUID.randomUUID()protected AbstractIdentifiable(java.util.UUID id)
id - Unique ID of the Identifiable.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.util.UUID getID()
IdentifiablegetID in interface Identifiablepublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object