public JsonElement serialize ( Enum < ? > src , Type typeOfSrc , JsonSerializationContext context ) { // Ignore this serializer for enums of class PaymentType. if ( src . getDeclaringClass ( ) . equals ( PaymentType . class ) ) { return context . serialize ( src . name ( ) ) ; } return context . serialize ( src . name ( ) . toLowerCase ( ) ) ; }
Serializes an Enum as its lowercase name .