Answering both questions with simplified code:
if (SerialPort.available() > 0) {
for (Field field : fields) {
Type type = field.getType();
if (type == boolean.class) { field.setByte(this, SerialPort.readByte()); }
else if (type == byte.class) { field.setByte(this, SerialPort.readByte()); }
// ...
Reading Integer
will be reading 4 bytes with
// Declared once somewhere
byte[] buffer = byte[4];
// ...
SerialPort.readBytes(buffer);
int value = convert_to_big_endian(buffer); // Or just use small ByteBuffer