Utf8 name = new Utf8("john");
long dateOfBirth = System.currentTimeMillis();
int salary = 1337;
Utf8 ssn = new Utf8(String.valueOf(RANDOM.nextLong()));
Employee e = new Employee();
e.setName(name);
e.setDateOfBirth(dateOfBirth);
e.setSalary(salary);
e.setSsn(ssn);
byte[] employerBytes = HBaseByteInterface.toBytes(e, Employee._SCHEMA);
Employee e2 = (Employee) HBaseByteInterface.fromBytes(Employee._SCHEMA,
employerBytes);
Assert.assertEquals(name, e2.getName());
Assert.assertEquals(dateOfBirth, e2.getDateOfBirth());
Assert.assertEquals(salary, e2.getSalary());
Assert.assertEquals(ssn, e2.getSsn());
//metadata
Utf8 key = new Utf8("theKey");
Utf8 value = new Utf8("theValue " + RANDOM.nextLong());