org.glassfish.jersey.internal.util
Class LazyUid

java.lang.Object
  extended by org.glassfish.jersey.internal.util.LazyUid
All Implemented Interfaces:
Serializable

public class LazyUid
extends Object
implements Serializable

Lazily initialized, thread-safe, random UUID. Useful for identifying instances for logging & debugging purposes.

The UUID value gets initialized with the first call to value() method. Once initialized, the UUID value stays the same.

Author:
Marek Potociar (marek.potociar at oracle.com)
See Also:
Serialized Form

Constructor Summary
LazyUid()
           
 
Method Summary
 boolean equals(Object that)
           
 int hashCode()
           
 String toString()
           
 String value()
          Return UUID value.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LazyUid

public LazyUid()
Method Detail

value

public String value()
Return UUID value. The returned value is never null.

Returns:
UUID value.

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2007-2014, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.