A DESCRIPTION OF THE PROBLEM : The `java.util.UUID` class represents UUID values, 128-bit values with a bit pattern defined by RFC 4122 as linked in the class documentation. Section 4.1.7 of that RFC defines a 'nil UUID' made of zeros. To quote the RFC: 'The nil UUID is special form of UUID that is specified to have all 128 bits set to zero.' For the convenience of Java programmers, I suggest adding a constant value to the `java.util.UUID` class named `NIL`, with a fixed value of all zeros across the bits. A `UUID.NIL` constant would be quite handy for code where we are passing and checking for nil UUID values as temporary placeholders or to avoid NULL values. Instead of having to repeatedly instantiate our own: UUID nil = new UUID( 0L , 0L ) ; person.id = nil ; // Placeholder until a proper UUID value is generated later. we could use the constant. person.id = UUID.NIL ; // Placeholder until a proper UUID value is generated later.
|