{@inheritDoc}
Encodes the given UUID as a sequence of 2 Longs, withe the Most Significant Bits first, followed by Least
Significant bits.

@param uuid The value to encode.
976554
@Override
    public void writeUUID(UUID uuid) throws IOException {
        writeLong(uuid.getMostSignificantBits());
        writeLong(uuid.getLeastSignificantBits());
    }
786244
@Override
	public void removeByUuid(String uuid) {
		for (CPDAvailabilityEstimate cpdAvailabilityEstimate : findByUuid(
				uuid, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(cpdAvailabilityEstimate);
		}
	}
217300
def uuid2buid(value):
    
    if six.PY3:  # pragma: no cover
        return urlsafe_b64encode(value.bytes).decode('utf-8').rstrip('=')
    else:
        return six.text_type(urlsafe_b64encode(value.bytes).rstrip('='))
210593
public static java.util.UUID fromUU64(String uu64) {
        String uu16 = UU16FromUU64(uu64);
        return java.util.UUID.fromString(UU(uu16));
    }
789228
private boolean isUUID(String uuid) {
        try {
            UUID.fromString(uuid);
            return true;
        } catch (Exception ex) {
            return false;
        }
    }
1359900
public static UUID readUUID(ArrayView source, int position) {
        long msb = readLong(source, position);
        long lsb = readLong(source, position + Long.BYTES);
        return new UUID(msb, lsb);
    }
1286745
@Override
	public void removeByUuid(String uuid) {
		for (CPDefinitionInventory cpDefinitionInventory : findByUuid(uuid,
				QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(cpDefinitionInventory);
		}
	}
842309
public function encodeBinary(UuidInterface $uuid)
    {
        $components = array_values($uuid->getFieldsHex());

        return hex2bin(implode('', $components));
    }
341409
@Override
    public byte[] encodeAsBytes(long time, int sequence) {
        byte[] buffer = new byte[16];
        buffer[0] = (byte) (time >>> 56);
        buffer[1] = (byte) (time >>> 48);
        buffer[2] = (byte) (time >>> 40);
        buffer[3] = (byte) (time >>> 32);
        buffer[4] = (byte) (time >>> 24);
        buffer[5] = (byte) (time >>> 16);
        buffer[6] = (byte) (time >>> 8);
        buffer[7] = (byte) (time);

        long rest = shiftedMachineId | (0x0000FFFF & sequence);
        buffer[8] = (byte) (rest >>> 56);
        buffer[9] = (byte) (rest >>> 48);
        buffer[10] = (byte) (rest >>> 40);
        buffer[11] = (byte) (rest >>> 32);
        buffer[12] = (byte) (rest >>> 24);
        buffer[13] = (byte) (rest >>> 16);
        buffer[14] = (byte) (rest >>> 8);
        buffer[15] = (byte) (rest);

        return buffer;
    }
1247565
public static ByteBuffer asByteBuffer(java.util.UUID uuid) {
        if (uuid == null) {
            return null;
        }

        return ByteBuffer.wrap(asByteArray(uuid));
    }
996504
public static boolean isUuid(final String uuid) {
        return uuid != null && (uuid.length() == 36 || uuid.length() == 32)
                && UUID_PATTERN.matcher(uuid).matches();
    }
1143403
@Override
	public void removeByUuid(String uuid) {
		for (CommerceDiscount commerceDiscount : findByUuid(uuid,
				QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(commerceDiscount);
		}
	}
725964
@Override
	public void removeByUuid(String uuid) {
		for (CPDefinitionOptionRel cpDefinitionOptionRel : findByUuid(uuid,
				QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(cpDefinitionOptionRel);
		}
	}
342871
@Override
	public void removeByUuid(String uuid) {
		for (CommerceTierPriceEntry commerceTierPriceEntry : findByUuid(uuid,
				QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(commerceTierPriceEntry);
		}
	}
791694
private void encode(long bits, StringBuilder sb) {
        if (bits < 0) {
            sb.append(characters[(int) ((bits % base + base) % base)]);

            bits /= -base;
        }

        while (bits > 0) {
            sb.append(characters[(int) (bits % base)]);

            bits /= base;
        }
    }
816272
@Override
	public void removeByUuid(String uuid) {
		for (CPDefinitionGroupedEntry cpDefinitionGroupedEntry : findByUuid(
				uuid, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(cpDefinitionGroupedEntry);
		}
	}
953182
public static byte[] toBytes(UUID id) {
    byte[] bytes = new byte[16];
    ByteUtils.writeLong(id.getMostSignificantBits(), bytes, 0);
    ByteUtils.writeLong(id.getLeastSignificantBits(), bytes, 8);
    return bytes;
  }