コード例 #1
0
 private User createUser2() {
   User user = new User();
   user.setId(1);
   user.setName("Adrian");
   user.setSurname("Nistor");
   user.setGender(User.Gender.MALE);
   Address address = new Address();
   address.setStreet("Old Street");
   address.setPostCode("XYZ");
   user.setAddresses(Collections.singletonList(address));
   return user;
 }
コード例 #2
0
 private User createUser1() {
   User user = new User();
   user.setId(1);
   user.setName("Tom");
   user.setSurname("Cat");
   user.setGender(User.Gender.MALE);
   user.setAccountIds(Collections.singletonList(12));
   Address address = new Address();
   address.setStreet("Dark Alley");
   address.setPostCode("1234");
   user.setAddresses(Collections.singletonList(address));
   return user;
 }
コード例 #3
0
  private byte[] createMarshalledUser(String name, String surname) throws IOException {
    User user = new User();
    user.setId(1);
    user.setName(name);
    user.setSurname(surname);
    user.setGender(User.Gender.MALE);
    user.setAccountIds(Collections.singleton(12));

    Address address = new Address();
    address.setStreet("Dark Alley");
    address.setPostCode("1234");
    user.setAddresses(Collections.singletonList(address));

    return ProtobufUtil.toWrappedByteArray(
        ProtobufMetadataManagerImpl.getSerializationContextInternal(cacheManager), user);
  }