Class 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
    See Also:
    Serialized Form
    • Constructor Detail

      • LazyUid

        public LazyUid()
    • Method Detail

      • value

        public String value()
        Return UUID value. The returned value is never null.
        Returns:
        UUID value.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object