Class BendableLongScoreJacksonSerializer
- java.lang.Object
-
- com.fasterxml.jackson.databind.JsonSerializer<Score_>
-
- org.optaplanner.persistence.jackson.api.score.AbstractScoreJacksonSerializer<BendableLongScore>
-
- org.optaplanner.persistence.jackson.api.score.buildin.bendablelong.BendableLongScoreJacksonSerializer
-
- All Implemented Interfaces:
com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable
,com.fasterxml.jackson.databind.ser.ContextualSerializer
public class BendableLongScoreJacksonSerializer extends AbstractScoreJacksonSerializer<BendableLongScore>
Jackson binding support for aScore
subtype. For aScore
field, usePolymorphicScoreJacksonSerializer
instead, so the score type is recorded too and it can be deserialized.For example: use
@JsonSerialize(using = HardSoftScoreJacksonSerializer.class) @JsonDeserialize(using = HardSoftScoreJacksonDeserializer.class)
on aHardSoftScore score
field and it will marshalled to JSON as"score":"-999hard/-999soft"
. Or better yet, useOptaPlannerJacksonModule
instead.
-
-
Constructor Summary
Constructors Constructor Description BendableLongScoreJacksonSerializer()
-
Method Summary
-
Methods inherited from class org.optaplanner.persistence.jackson.api.score.AbstractScoreJacksonSerializer
createContextual, serialize
-
-