org.sonatype.sisu.goodies.common
Class OID

java.lang.Object
  extended by org.sonatype.sisu.goodies.common.OID

public class OID
extends Object

Provides a general identifier for objects. String representation should follow the default behavior of Object.toString(). hashCode()/equals(java.lang.Object) behavior differs to make the OID unique based on type and hash. When constructing from an object the hash is always the System.identityHashCode(java.lang.Object).

Since:
1.0

Field Summary
static OID NULL
           
 
Method Summary
 boolean equals(Object obj)
           
static
<T> T
find(Collection<T> items, OID id)
           
static
<T> T
find(Collection<T> items, String id)
           
static OID get(Object obj)
           
 int getHash()
           
 String getType()
           
 int hashCode()
           
static OID oid(Object obj)
           
static OID parse(String spec)
           
static String render(Object obj)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NULL

public static final OID NULL
Method Detail

getType

public String getType()

getHash

public int getHash()

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

get

public static OID get(Object obj)

oid

public static OID oid(Object obj)
Since:
1.1
See Also:
get(java.lang.Object)

parse

public static OID parse(String spec)

render

public static String render(Object obj)

find

public static <T> T find(Collection<T> items,
                         String id)

find

public static <T> T find(Collection<T> items,
                         OID id)


Copyright © 2008-2012 Sonatype, Inc.. All Rights Reserved.