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 datatime- 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 dataObtainMethodsurplusEnergyKWh- 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 Summary
ConstructorsConstructorDescriptionMeteringData(String cups, LocalDate date, String time, double consumptionKWh, ObtainMethod obtainMethod, double surplusEnergyKWh) Creates an instance of aMeteringDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of theconsumptionKWhrecord component.cups()Returns the value of thecupsrecord component.date()Returns the value of thedaterecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theobtainMethodrecord component.doubleReturns the value of thesurplusEnergyKWhrecord component.time()Returns the value of thetimerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MeteringData
public MeteringData(String cups, LocalDate date, String time, double consumptionKWh, ObtainMethod obtainMethod, double surplusEnergyKWh) Creates an instance of aMeteringDatarecord class.- Parameters:
cups- the value for thecupsrecord componentdate- the value for thedaterecord componenttime- the value for thetimerecord componentconsumptionKWh- the value for theconsumptionKWhrecord componentobtainMethod- the value for theobtainMethodrecord componentsurplusEnergyKWh- the value for thesurplusEnergyKWhrecord component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
cups
Returns the value of thecupsrecord component.- Returns:
- the value of the
cupsrecord component
-
date
Returns the value of thedaterecord component.- Returns:
- the value of the
daterecord component
-
time
Returns the value of thetimerecord component.- Returns:
- the value of the
timerecord component
-
consumptionKWh
public double consumptionKWh()Returns the value of theconsumptionKWhrecord component.- Returns:
- the value of the
consumptionKWhrecord component
-
obtainMethod
Returns the value of theobtainMethodrecord component.- Returns:
- the value of the
obtainMethodrecord component
-
surplusEnergyKWh
public double surplusEnergyKWh()Returns the value of thesurplusEnergyKWhrecord component.- Returns:
- the value of the
surplusEnergyKWhrecord component
-