Refine search
@Override public boolean isEmpty(SerializerProvider prov, UUID value) { // Null UUID is empty, so... if (value.getLeastSignificantBits() == 0L && value.getMostSignificantBits() == 0L) { return true; } return false; }
@Override public boolean isEmpty(SerializerProvider prov, UUID value) { // Null UUID is empty, so... if (value.getLeastSignificantBits() == 0L && value.getMostSignificantBits() == 0L) { return true; } return false; }
public static byte[] convert(UUID uuid) { long msb = uuid.getMostSignificantBits(); long lsb = uuid.getLeastSignificantBits(); byte[] buffer = new byte[16]; for (int i = 0; i < 8; i++) { buffer[i] = (byte) (msb >>> 8 * (7 - i)); } for (int i = 8; i < 16; i++) { buffer[i] = (byte) (lsb >>> 8 * (7 - i)); } return buffer; }
public static String UU32(java.util.UUID uu) { StringBuilder sb = new StringBuilder(); long m = uu.getMostSignificantBits(); long l = uu.getLeastSignificantBits(); for (int i = 0; i < 13; i++) { sb.append(_UU32[(int) (m >> ((13 - i - 1) * 5)) & 31]); } for (int i = 0; i < 13; i++) { sb.append(_UU32[(int) (l >> ((13 - i - 1)) * 5) & 31]); } return sb.toString(); }
public static String UU32(java.util.UUID uu) { StringBuilder sb = new StringBuilder(); long m = uu.getMostSignificantBits(); long l = uu.getLeastSignificantBits(); for (int i = 0; i < 13; i++) { sb.append(_UU32[(int) (m >> ((13 - i - 1) * 5)) & 31]); } for (int i = 0; i < 13; i++) { sb.append(_UU32[(int) (l >> ((13 - i - 1)) * 5) & 31]); } return sb.toString(); }
@Override void encodeValue(DataOutputStream dos) throws IOException { dos.writeLong(value.getMostSignificantBits()); dos.writeLong(value.getLeastSignificantBits()); }
@Override public void writeObject(ObjectOutput output, UUID uuid) throws IOException { output.writeLong(uuid.getMostSignificantBits()); output.writeLong(uuid.getLeastSignificantBits()); }
public static DictionaryId randomDictionaryId() { return new DictionaryId(nodeId.getMostSignificantBits(), nodeId.getLeastSignificantBits(), sequenceGenerator.getAndIncrement()); }
@Override public byte[] convertToPersisted(UUID value) { if (value == null) { return null; } byte[] bytes = new byte[16]; ByteBuffer buffer = ByteBuffer.wrap(bytes); buffer.putLong(value.getMostSignificantBits()); buffer.putLong(value.getLeastSignificantBits()); return bytes; }
public static DictionaryId randomDictionaryId() { return new DictionaryId(nodeId.getMostSignificantBits(), nodeId.getLeastSignificantBits(), sequenceGenerator.getAndIncrement()); }
private static byte[] uuidToByteArray(UUID uuid) { ByteBuffer bb = ByteBuffer.wrap(new byte[16]); bb.putLong(uuid.getMostSignificantBits()); bb.putLong(uuid.getLeastSignificantBits()); return bb.array(); }
public static byte[] uuidToByteArray(UUID uuid) { ByteBuffer bb = ByteBuffer.wrap(new byte[16]); bb.putLong(uuid.getMostSignificantBits()); bb.putLong(uuid.getLeastSignificantBits()); return bb.array(); }
@Override public final ByteBuffer convert(final java.util.UUID o) { final ByteBuffer value = ByteBuffer.allocate(16); value.putLong(o.getMostSignificantBits()).putLong(o.getLeastSignificantBits()); value.position(0); return value; } };
static public String rand() { UUID uid = UUID.randomUUID(); long l1 = uid.getLeastSignificantBits(); long l2 = uid. getMostSignificantBits(); return "_"+Long.toHexString(l1)+Long.toHexString(l2); }
@Override public void writeToParcel(Parcel dest, int flags) { dest.writeLong(uuid.getMostSignificantBits()); dest.writeLong(uuid.getLeastSignificantBits()); dest.writeString(licenseServerUrl); dest.writeString(mimeType); dest.writeByteArray(data); dest.writeByte((byte) (requiresSecureDecryption ? 1 : 0)); }
public static String UU32(UUID uu) { StringBuilder sb = new StringBuilder(); long m = uu.getMostSignificantBits(); long l = uu.getLeastSignificantBits(); for (int i = 0; i < 13; i++) { sb.append(_UU32[(int) (m >> ((13 - i - 1) * 5)) & 31]); } for (int i = 0; i < 13; i++) { sb.append(_UU32[(int) (l >> ((13 - i - 1)) * 5) & 31]); } return sb.toString(); }
private static byte[] encode(final UUID uuid) { final ByteBuffer bb = ByteBuffer.wrap(new byte[17]); bb.put((byte) 0x09); bb.putLong(uuid.getMostSignificantBits()); bb.putLong(uuid.getLeastSignificantBits()); return bb.array(); }
/** * Get or create a UUID for the given Java UUID. * * @param uuid Java UUID * @return the UUID */ public static ValueUuid get(UUID uuid) { return get(uuid.getMostSignificantBits(), uuid.getLeastSignificantBits()); }
/** * Converts UUID value to byte array in big-endian order. * * @param uuid * UUID value * @return byte array representation */ public static byte[] uuidToBytes(UUID uuid) { return uuidToBytes(uuid.getMostSignificantBits(), uuid.getLeastSignificantBits()); }
public THandleIdentifier toTHandleIdentifier() { byte[] guid = new byte[16]; byte[] secret = new byte[16]; ByteBuffer guidBB = ByteBuffer.wrap(guid); ByteBuffer secretBB = ByteBuffer.wrap(secret); guidBB.putLong(publicId.getMostSignificantBits()); guidBB.putLong(publicId.getLeastSignificantBits()); secretBB.putLong(secretId.getMostSignificantBits()); secretBB.putLong(secretId.getLeastSignificantBits()); return new THandleIdentifier(ByteBuffer.wrap(guid), ByteBuffer.wrap(secret)); }