org.optaplanner.persistence.jackson.api.score

## Class PolymorphicScoreJacksonJsonDeserializer

- java.lang.Object
- - com.fasterxml.jackson.databind.JsonDeserializer<Score>
  - - org.optaplanner.persistence.jackson.api.score.PolymorphicScoreJacksonJsonDeserializer

- All Implemented Interfaces:
    com.fasterxml.jackson.databind.deser.NullValueProvider

      public class PolymorphicScoreJacksonJsonDeserializer
      extends com.fasterxml.jackson.databind.JsonDeserializer<Score>

  Jackson binding support for a `Score` type (but not a subtype). For a `Score` subtype field, use `HardSoftScoreJacksonJsonDeserializer` or similar instead.

  For example: use `@JsonSerialize(using = PolymorphicScoreJacksonJsonSerializer.class) @JsonDeserialize(using = PolymorphicScoreJacksonJsonDeserializer.class)` on a `Score score` field which contains a `HardSoftScore` instance and it will marshalled to JSON as `"score":{"type":"HARD_SOFT",score:"-999hard/-999soft"}`.

  See Also:
    `Score`, `PolymorphicScoreJacksonJsonDeserializer`

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.JsonDeserializer

      `com.fasterxml.jackson.databind.JsonDeserializer.None`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PolymorphicScoreJacksonJsonDeserializer()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Score` | `deserialize(com.fasterxml.jackson.core.JsonParser parser, com.fasterxml.jackson.databind.DeserializationContext context)`

    - ### Methods inherited from class com.fasterxml.jackson.databind.JsonDeserializer

      `deserialize, deserializeWithType, deserializeWithType, findBackReference, getDelegatee, getEmptyAccessPattern, getEmptyValue, getEmptyValue, getKnownPropertyNames, getNullAccessPattern, getNullValue, getNullValue, getObjectIdReader, handledType, isCachable, replaceDelegatee, supportsUpdate, unwrappingDeserializer`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PolymorphicScoreJacksonJsonDeserializer

          public PolymorphicScoreJacksonJsonDeserializer()

  - ### Method Detail

    - #### deserialize

          public Score deserialize(com.fasterxml.jackson.core.JsonParser parser,
                                   com.fasterxml.jackson.databind.DeserializationContext context)
                            throws IOException

      Specified by:
        `deserialize` in class `com.fasterxml.jackson.databind.JsonDeserializer<Score>`
      Throws:
        `IOException`

Copyright © 2006–2020 JBoss by Red Hat. All rights reserved.