Class EtaPlusVhdMappings

java.lang.Object
energy.eddie.regionconnector.de.eta.providers.EtaPlusVhdMappings

public final class EtaPlusVhdMappings extends Object
Shared wire-string-to-CIM mappings used by both v0.82 and v1.04 intermediate VHD documents.

Holds only logic that is identical across CIM versions; version-specific enum lookups stay in the intermediate docs themselves so each one keeps its own type signatures.

  • Method Details

    • isProduction

      public static boolean isProduction(String direction)
      true if the wire direction is "Generation" (prosumer feed-in).
    • isValidatedStatus

      public static boolean isValidatedStatus(String wireStatus)
      true if the wire status is "VALIDATED" — the only value the /meters/historical endpoint emits per contract.
    • sortByTimestamp

      public static List<EtaPlusMeteredData.MeterReading> sortByTimestamp(List<EtaPlusMeteredData.MeterReading> readings)
      Returns readings ordered by ascending timestamp.
    • energyTypeFromUnit

      @Nullable public static EnergyType energyTypeFromUnit(@Nullable String unit)
      Returns the EnergyType that corresponds to the wire unit string, or null if the unit is not recognised.

      Per ETA Plus contract, the unit is constant within a historical-readings response, so checking the first reading's unit is sufficient to determine the energy type.

    • inferGranularity

      @Nullable public static Granularity inferGranularity(List<EtaPlusMeteredData.MeterReading> sortedReadings)
      Infers the data Granularity from the interval between the first two entries of an already-sorted reading list, or null if fewer than two readings are present or the interval does not match any known Granularity value.