Class LazyUid
- java.lang.Object
-
- org.glassfish.jersey.internal.util.LazyUid
-
- All Implemented Interfaces:
java.io.Serializable
public class LazyUid extends java.lang.Object implements java.io.Serializable
Lazily initialized, thread-safe, random UUID. Useful for identifying instances for logging & debugging purposes. The UUID value gets initialized with the first call tovalue()
method. Once initialized, the UUID value stays the same.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
private java.util.concurrent.atomic.AtomicReference<java.lang.String>
uid
-
Constructor Summary
Constructors Constructor Description LazyUid()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object that)
int
hashCode()
java.lang.String
toString()
java.lang.String
value()
Return UUID value.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
uid
private final java.util.concurrent.atomic.AtomicReference<java.lang.String> uid
-
-
Method Detail
-
value
public java.lang.String value()
Return UUID value. The returned value is nevernull
.- Returns:
- UUID value.
-
equals
public boolean equals(java.lang.Object that)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-