Record Class MeteringDataRequest

java.lang.Object
java.lang.Record
energy.eddie.regionconnector.es.datadis.dtos.MeteringDataRequest
Record Components:
authorizedNif - NIF of the user for which the data is requested
meteringPoint - Metering point for which the data is requested (from Supply request)
distributorCode - Distributor code for associated with the metering point (from Supply request)
startDate - Start date of the period for which the data is requested (inclusive, only year and month are used)
endDate - End date of the period for which the data is requested (inclusive, only year and month are used)
measurementType - Type of measurement (hourly or quarter-hourly)
pointType - Type of metering point (from Supply request)

public record MeteringDataRequest(String authorizedNif, String meteringPoint, String distributorCode, LocalDate startDate, LocalDate endDate, MeasurementType measurementType, String pointType) extends Record
Represents all the data needed to request metering data from Datadis.
  • Constructor Details

    • MeteringDataRequest

      public MeteringDataRequest(String authorizedNif, String meteringPoint, String distributorCode, LocalDate startDate, LocalDate endDate, MeasurementType measurementType, String pointType)
      Creates an instance of a MeteringDataRequest record class.
      Parameters:
      authorizedNif - the value for the authorizedNif record component
      meteringPoint - the value for the meteringPoint record component
      distributorCode - the value for the distributorCode record component
      startDate - the value for the startDate record component
      endDate - the value for the endDate record component
      measurementType - the value for the measurementType record component
      pointType - the value for the pointType record component
  • Method Details

    • fromPermissionRequest

      public static MeteringDataRequest fromPermissionRequest(EsPermissionRequest permissionRequest, LocalDate startDate, LocalDate endDate)
    • minusMonths

      public MeteringDataRequest minusMonths(int months)
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • authorizedNif

      public String authorizedNif()
      Returns the value of the authorizedNif record component.
      Returns:
      the value of the authorizedNif record component
    • meteringPoint

      public String meteringPoint()
      Returns the value of the meteringPoint record component.
      Returns:
      the value of the meteringPoint record component
    • distributorCode

      public String distributorCode()
      Returns the value of the distributorCode record component.
      Returns:
      the value of the distributorCode record component
    • startDate

      public LocalDate startDate()
      Returns the value of the startDate record component.
      Returns:
      the value of the startDate record component
    • endDate

      public LocalDate endDate()
      Returns the value of the endDate record component.
      Returns:
      the value of the endDate record component
    • measurementType

      public MeasurementType measurementType()
      Returns the value of the measurementType record component.
      Returns:
      the value of the measurementType record component
    • pointType

      public String pointType()
      Returns the value of the pointType record component.
      Returns:
      the value of the pointType record component