@Test public void testInsert() { final List<Byte> packet = new ArrayList<>(singletonList((byte) 0xFF)); converter.insert(packet, fromString("01234567-0123-4567-89AB-456789ABCDEF")); assertEquals( asList( (byte) 0xFF, (byte) 0x01, (byte) 0x23, (byte) 0x45, (byte) 0x67, (byte) 0x01, (byte) 0x23, (byte) 0x45, (byte) 0x67, (byte) 0x89, (byte) 0xAB, (byte) 0x45, (byte) 0x67, (byte) 0x89, (byte) 0xAB, (byte) 0xCD, (byte) 0xEF ), packet ); }
@Override public void insert(@NonNull List<Byte> packet, @NonNull Object value) { final UUID uuid = (UUID) value; ByteBuffer .wrap(bytes) .order(ByteOrder.BIG_ENDIAN) .putLong(uuid.getMostSignificantBits()) .putLong(uuid.getLeastSignificantBits()); for (int i = 0; i < UUID_BYTE_SIZE; i++) { packet.add(bytes[i]); } }
UuidFieldConverter implements IFieldConverter<UUID> { @Override public void insert(@NonNull List<Byte> packet, @NonNull Object value) { final UUID uuid = (UUID) value; ByteBuffer .wrap(bytes) .order(ByteOrder.BIG_ENDIAN) .putLong(uuid.getMostSignificantBits()) .putLong(uuid.getLeastSignificantBits()); for (int i = 0; i < UUID_BYTE_SIZE; i++) { packet.add(bytes[i]); } } }
UuidFieldConverter implements IFieldConverter<UUID> { @Override public void insert(@NonNull List<Byte> packet, @NonNull Object value) { final UUID uuid = (UUID) value; ByteBuffer .wrap(bytes) .order(ByteOrder.BIG_ENDIAN) .putLong(uuid.getMostSignificantBits()) .putLong(uuid.getLeastSignificantBits()); for (int i = 0; i < UUID_BYTE_SIZE; i++) { packet.add(bytes[i]); } }  }
UuidFieldConverter implements IFieldConverter<UUID> { @Override public void insert(@NonNull List<Byte> packet, @NonNull Object value) { final UUID uuid = (UUID) value; ByteBuffer .wrap(bytes) .order(ByteOrder.BIG_ENDIAN) .putLong(uuid.getMostSignificantBits()) .putLong(uuid.getLeastSignificantBits()); for (int i = 0; i < UUID_BYTE_SIZE; i++) { packet.add(bytes[i]); } }  @Override UUID consume(@NonNull List<Byte> packet); @Override void insert(@NonNull List<Byte> packet, @NonNull Object value); @Override void insertMask(@NonNull List<Byte> packet, byte maskBit); @Override boolean canParse(@NonNull Class<?> clazz); @Override boolean canParse(int numberOfBytes); }
UuidFieldConverter implements IFieldConverter<UUID> { @Override public void insert(@NonNull List<Byte> packet, @NonNull Object value) { final UUID uuid = (UUID) value; ByteBuffer .wrap(bytes) .order(ByteOrder.BIG_ENDIAN) .putLong(uuid.getMostSignificantBits()) .putLong(uuid.getLeastSignificantBits()); for (int i = 0; i < UUID_BYTE_SIZE; i++) { packet.add(bytes[i]); } }  @Override UUID consume(@NonNull List<Byte> packet); @Override void insert(@NonNull List<Byte> packet, @NonNull Object value); @Override void insertMask(@NonNull List<Byte> packet, byte maskBit); @Override boolean canParse(@NonNull Class<?> clazz); @Override boolean canParse(int numberOfBytes);  }