@ 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 ) ; }
Encodes the name assignment to bytes .