Record Class MeteringData

java.lang.Object
java.lang.Record
energy.eddie.regionconnector.es.datadis.dtos.MeteringData
Record Components:
cups - the CUPS identifier (metering point identifier)
date - the date of the metering data
time - the time of the metering data in the format "HH:mm"
consumptionKWh - the consumption in kWh (always present)
obtainMethod - the method used to obtain the metering data ObtainMethod
surplusEnergyKWh - the surplus energy in kWh. The default value is 0, this can't be used to determine if the metering data contains surplus energy, as Datadis does not define if a DSO is required to return surplus energy data if it is 0

public record MeteringData(String cups, LocalDate date, String time, double consumptionKWh, ObtainMethod obtainMethod, double surplusEnergyKWh) extends Record
This class represents the metering data returned by the Datadis API. It contains both consumption and surplus energy (production) data.
  • Constructor Details

    • MeteringData

      public MeteringData(String cups, LocalDate date, String time, double consumptionKWh, ObtainMethod obtainMethod, double surplusEnergyKWh)
      Creates an instance of a MeteringData record class.
      Parameters:
      cups - the value for the cups record component
      date - the value for the date record component
      time - the value for the time record component
      consumptionKWh - the value for the consumptionKWh record component
      obtainMethod - the value for the obtainMethod record component
      surplusEnergyKWh - the value for the surplusEnergyKWh record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • cups

      public String cups()
      Returns the value of the cups record component.
      Returns:
      the value of the cups record component
    • date

      public LocalDate date()
      Returns the value of the date record component.
      Returns:
      the value of the date record component
    • time

      public String time()
      Returns the value of the time record component.
      Returns:
      the value of the time record component
    • consumptionKWh

      public double consumptionKWh()
      Returns the value of the consumptionKWh record component.
      Returns:
      the value of the consumptionKWh record component
    • obtainMethod

      public ObtainMethod obtainMethod()
      Returns the value of the obtainMethod record component.
      Returns:
      the value of the obtainMethod record component
    • surplusEnergyKWh

      public double surplusEnergyKWh()
      Returns the value of the surplusEnergyKWh record component.
      Returns:
      the value of the surplusEnergyKWh record component