Class SegmentListDeserializer

java.lang.Object
tools.jackson.databind.ValueDeserializer<List<String>>
energy.eddie.regionconnector.fr.enedis.dto.situation.SegmentListDeserializer
All Implemented Interfaces:
tools.jackson.databind.deser.NullValueProvider

public class SegmentListDeserializer extends tools.jackson.databind.ValueDeserializer<List<String>>
Reads the PRM segments of situation_contrat_auto regardless of which of the documented candidate shapes Enedis actually returns.

The published Swagger leaves the contracts schema unexpanded, so the shape is not pinned by the spec. Three candidates are known: a bare array (["C5"]), an array of segment objects ([{"segment": "C5"}], which is how the sibling synth_contrat_auto API documents the same concept), and a single scalar ("C5", which is how the ITC guide renders it as segment: ex. C5, P4).

A type mismatch here would abort the entire master-data fetch, so the permission request would never reach a terminal status. Accepting all documented variants costs little and keeps the DTO correct whichever shape the sandbox returns.

  • Nested Class Summary

    Nested classes/interfaces inherited from class tools.jackson.databind.ValueDeserializer

    tools.jackson.databind.ValueDeserializer.None
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    deserialize(tools.jackson.core.JsonParser p, tools.jackson.databind.DeserializationContext ctxt)
     

    Methods inherited from class tools.jackson.databind.ValueDeserializer

    createContextual, deserialize, deserializeWithType, deserializeWithType, findBackReference, getAbsentValue, getDelegatee, getEmptyAccessPattern, getEmptyValue, getKnownPropertyNames, getNullAccessPattern, getNullValue, getObjectIdReader, handledType, isCachable, logicalType, replaceDelegatee, resolve, supportsUpdate, unwrappingDeserializer

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SegmentListDeserializer

      public SegmentListDeserializer()
  • Method Details

    • deserialize

      public List<String> deserialize(tools.jackson.core.JsonParser p, tools.jackson.databind.DeserializationContext ctxt)
      Specified by:
      deserialize in class tools.jackson.databind.ValueDeserializer<List<String>>