code: @Override
    public byte[] encode(final NamingRegisterRequest obj) {
      final AvroNamingRegisterRequest result = AvroNamingRegisterRequest.newBuilder()
          .setId(obj.getNameAssignment().getIdentifier().toString())
          .setHost(obj.getNameAssignment().getAddress().getHostName())
          .setPort(obj.getNameAssignment().getAddress().getPort())
          .build();
      return AvroUtils.toBytes(result, AvroNamingRegisterRequest.class);
    }
docs: Encodes the name assignment to bytes.
  
  @param obj the naming registration request
  @return a byte array