if (keyType.isEnumType()) { // non-enum if we got it as type erased class (from instance)
@SuppressWarnings("unchecked")
Class<Enum<?>> enumClass = (Class<Enum<?>>) keyType.getRawClass();
enums = EnumValues.construct(enumClass, config.getAnnotationIntrospector());
}
return new EnumMapSerializer(type.getContentType(), staticTyping, enums,
elementTypeSerializer, property, elementValueSerializer);
}