Search in sources :

Example 1 with FlagsUUID

use of org.jgroups.util.FlagsUUID in project JGroups by belaban.

the class ExtendedUUIDTest method testFlags2.

public void testFlags2() throws Exception {
    FlagsUUID uuid = FlagsUUID.randomUUID("A").setFlag(RELAY2.site_master_flag).setFlag((short) 2).setFlag((short) 4);
    System.out.println("uuid = " + uuid);
    assert uuid.isFlagSet(RELAY2.site_master_flag);
    assert uuid.isFlagSet((short) 2);
    assert uuid.isFlagSet((short) 4);
    uuid.clearFlag((short) 2);
    assert !uuid.isFlagSet((short) 2);
    byte[] buf = Util.streamableToByteBuffer(uuid);
    FlagsUUID uuid2 = Util.streamableFromByteBuffer(FlagsUUID::new, buf, 0, buf.length);
    assert uuid.equals(uuid2);
}
Also used : FlagsUUID(org.jgroups.util.FlagsUUID)

Aggregations

FlagsUUID (org.jgroups.util.FlagsUUID)1