You can also use the annotation: `@JsonEnumDefaultValue`: [JavaDocs](https://www.javadoc.io/doc/com.fasterxml.jackson.core/jackson-annotations/latest/com.fasterxml.jackson.annotation/com/fasterxml/jackson/annotation/JsonEnumDefaultValue.html)
For example:
```
public enum PartsOfSpeech2 {
n("noun"),
wp("标点"),
a("adjective"),
d("conjunction"),
@JsonEnumDefaultValue DEFAULT("default")
}
```
The only catch for this is that you need to add the deserializer property as well to the mapper;
```
ObjectMapper mapper = new ObjectMapper();
mapper.enable(DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_USING_DEFAULT_VALUE);
```
You can also use the annotation: `@JsonEnumDefaultValue`: [JavaDocs](https://www.javadoc.io/doc/com.fasterxml.jackson.core/jackson-annotations/latest/com.fasterxml.jackson.annotation/com/fasterxml/jackson/annotation/JsonEnumDefaultValue.html)
For example:
```
public enum PartsOfSpeech2 {
n("noun"),
wp("标点"),
a("adjective"),
d("conjunction"),
@JsonEnumDefaultValue DEFAULT("default")
}
```
The only catch for this is that you need to add the deserializer property as well to the mapper;
```
ObjectMapper mapper = new ObjectMapper();
mapper.enable(DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_USING_DEFAULT_VALUE);
```