public class Identifier extends Object
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(org.cojen.dirmi.core.AbstractIdentifier id)
Lexicographically compares two identifiers.
|
boolean |
equals(Object obj) |
int |
hashCode() |
static Identifier |
identify(Object obj)
Returns a new or existing unique identifier for the given object.
|
static Identifier |
read(DataInput in)
Returns a deserialized identifier, which may or may not have an object
registered with it.
|
static Identifier |
read(InputStream in)
Returns a deserialized identifier, which may or may not have an object
registered with it.
|
<T> void |
register(T obj)
Register the given object with this identifier.
|
String |
toString() |
Object |
tryRetrieve()
Returns the identified object, if it exists locally.
|
void |
write(DataOutput out) |
void |
write(OutputStream out) |
public static Identifier identify(Object obj)
IllegalArgumentException - if object is nullpublic static Identifier read(DataInput in) throws IOException
IOExceptionpublic static Identifier read(InputStream in) throws IOException
IOExceptionpublic Object tryRetrieve()
public <T> void register(T obj)
throws IllegalArgumentException
A registered object cannot be retrieved, but calling identify against a registered object returns the original identifier object.
IllegalArgumentException - if given object is nullpublic void write(DataOutput out) throws IOException
IOExceptionpublic void write(OutputStream out) throws IOException
IOExceptionpublic int compareTo(org.cojen.dirmi.core.AbstractIdentifier id)
compareTo in interface Comparable<org.cojen.dirmi.core.AbstractIdentifier>Copyright © 2006–2015 Cojen. All rights reserved.