use of org.infinispan.protostream.sampledomain.Address in project protostream by infinispan.
the class UserMarshaller method readFrom.
@Override
public User readFrom(ProtoStreamReader reader) throws IOException {
int id = reader.readInt("id");
Set<Integer> accountIds = reader.readCollection("accountIds", new HashSet<>(), Integer.class);
String name = reader.readString("name");
String surname = reader.readString("surname");
String salutation = reader.readString("salutation");
List<Address> addresses = reader.readCollection("addresses", new ArrayList<>(), Address.class);
Integer age = reader.readInt("age");
User.Gender gender = reader.readEnum("gender", User.Gender.class);
String notes = reader.readString("notes");
Instant creationDate = reader.readInstant("creationDate");
Instant passwordExpirationDate = reader.readInstant("passwordExpirationDate");
User user = new User();
user.setId(id);
user.setAccountIds(accountIds);
user.setName(name);
user.setSurname(surname);
user.setSalutation(salutation);
user.setAge(age);
user.setGender(gender);
user.setAddresses(addresses);
user.setNotes(notes);
user.setCreationDate(creationDate);
user.setPasswordExpirationDate(passwordExpirationDate);
return user;
}
Aggregations