private void encodeEnum ( GeneratorAdapter mg , TypeToken < ? > outputType , int value , int encoder , int schemaLocal ) { // encoder.writeInt(this.schema.getEnumIndex(value.name())); mg . loadArg ( encoder ) ; mg . loadArg ( schemaLocal ) ; mg . loadArg ( value ) ; mg . invokeVirtual ( Type . getType ( outputType . getRawType ( ) ) , getMethod ( String . class , "name" ) ) ; mg . invokeVirtual ( Type . getType ( Schema . class ) , getMethod ( int . class , "getEnumIndex" , String . class ) ) ; mg . invokeInterface ( Type . getType ( Encoder . class ) , getMethod ( Encoder . class , "writeInt" , int . class ) ) ; mg . pop ( ) ; }
Generates method body for encoding enum value .