private static MessageElement getMapKVMessageElements ( String name , MapType mapType ) { MessageElement . Builder ret = MessageElement . builder ( ) ; ret . name ( name ) ; DataType keyType = mapType . keyType ( ) ; Builder fieldBuilder = FieldElement . builder ( ) . name ( "key" ) . tag ( 1 ) ; fieldBuilder . type ( keyType ) . label ( FieldElement . Label . OPTIONAL ) ; ret . addField ( fieldBuilder . build ( ) ) ; DataType valueType = mapType . valueType ( ) ; fieldBuilder = FieldElement . builder ( ) . name ( "value" ) . tag ( 2 ) ; fieldBuilder . type ( valueType ) . label ( FieldElement . Label . OPTIONAL ) ; ret . addField ( fieldBuilder . build ( ) ) ; return ret . build ( ) ; }
Gets the map kv message elements .