## org.jgroups.util
Class PayloadUUID

    java.lang.Object
      org.jgroups.util.UUID
          org.jgroups.util.PayloadUUID

All Implemented Interfaces:
  java.io.Externalizable, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<Address>, Address, Streamable

    public class PayloadUUID

extends UUID

Subclass of `UUID` which adds a string as payload. An instance of this can be fed to `JChannel.setAddressGenerator(org.jgroups.stack.AddressGenerator)`, with the address generator creating PayloadUUIDs.

Author:
  Bela Ban
See Also:
  Serialized Form

Field Summary
`protected java.lang.String` `payload`

Fields inherited from class org.jgroups.util.UUID
`additional_data, cache, leastSigBits, mostSigBits, numberGenerator, print_function, print_uuids, SIZE`

Fields inherited from interface org.jgroups.Address
`IP_ADDR, NULL, UUID_ADDR`

Constructor Summary
`` `PayloadUUID()`
`protected` `PayloadUUID(byte[] data, java.lang.String payload)`

Method Summary
`protected static byte[]` `generateRandomBytes()`
`java.lang.String` `getPayload()`
`static PayloadUUID` `randomUUID(java.lang.String payload)`
`static PayloadUUID` `randomUUID(java.lang.String logical_name, java.lang.String payload)`
`void` `readExternal(java.io.ObjectInput in)`
`void` `readFrom(java.io.DataInputStream in)` Read the state of the current object (including superclasses) from instream Note that the input stream must not be closed
`void` `setPayload(java.lang.String payload)`
`int` `size()` Returns serialized size of this address
`java.lang.String` `toString()`
`void` `writeExternal(java.io.ObjectOutput out)`
`void` `writeTo(java.io.DataOutputStream out)` Write the entire state of the current object (including superclasses) to outstream.

Methods inherited from class org.jgroups.util.UUID
`add, add, clone, compareTo, digits, equals, get, getAdditionalData, getContents, getLeastSignificantBits, getMostSignificantBits, hashCode, isMulticastAddress, printCache, randomUUID, remove, removeAll, retainAll, setAdditionalData, toStringLong`

Methods inherited from class java.lang.Object
`finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### payload

    protected java.lang.String payload

Constructor Detail

### PayloadUUID

    public PayloadUUID()

### PayloadUUID

    protected PayloadUUID(byte[] data,
                          java.lang.String payload)

Method Detail

### randomUUID

    public static PayloadUUID randomUUID(java.lang.String payload)

### randomUUID

    public static PayloadUUID randomUUID(java.lang.String logical_name,
                                         java.lang.String payload)

### getPayload

    public java.lang.String getPayload()

### setPayload

    public void setPayload(java.lang.String payload)

### generateRandomBytes

    protected static byte[] generateRandomBytes()

### size

    public int size()

  Description copied from interface: `Address`
  Returns serialized size of this address

  Specified by:
    `size` in interface `Address`
  Overrides:
    `size` in class `UUID`

### writeTo

    public void writeTo(java.io.DataOutputStream out)
                 throws java.io.IOException

  Description copied from interface: `Streamable`
  Write the entire state of the current object (including superclasses) to outstream. Note that the output stream must not be closed

  Specified by:
    `writeTo` in interface `Streamable`
  Overrides:
    `writeTo` in class `UUID`
  Throws:
    `java.io.IOException`

### readFrom

    public void readFrom(java.io.DataInputStream in)
                  throws java.io.IOException,
                         java.lang.IllegalAccessException,
                         java.lang.InstantiationException

  Description copied from interface: `Streamable`
  Read the state of the current object (including superclasses) from instream Note that the input stream must not be closed

  Specified by:
    `readFrom` in interface `Streamable`
  Overrides:
    `readFrom` in class `UUID`
  Throws:
    `java.io.IOException`
    `java.lang.IllegalAccessException`
    `java.lang.InstantiationException`

### readExternal

    public void readExternal(java.io.ObjectInput in)
                      throws java.io.IOException,
                             java.lang.ClassNotFoundException

  Specified by:
    `readExternal` in interface `java.io.Externalizable`
  Overrides:
    `readExternal` in class `UUID`
  Throws:
    `java.io.IOException`
    `java.lang.ClassNotFoundException`

### writeExternal

    public void writeExternal(java.io.ObjectOutput out)
                       throws java.io.IOException

  Specified by:
    `writeExternal` in interface `java.io.Externalizable`
  Overrides:
    `writeExternal` in class `UUID`
  Throws:
    `java.io.IOException`

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `UUID`

Copyright © 1998-2009 Bela Ban / Red Hat. All Rights Reserved.