Record Class CarbonIntensityTable

java.lang.Object
java.lang.Record
com.eqixiac.equinix.design.sustainability.CarbonIntensityTable
Record Components:
gramsCo2ePerKwh - intensity per metro code, in grams of CO2-equivalent per kWh; finite, non-negative
source - where the figures come from (publisher and dataset); required
asOf - the period or date the figures describe (for example 2025 annual average); required
method - location-based, market-based or another stated method; required

public record CarbonIntensityTable(Map<String,Double> gramsCo2ePerKwh, String source, String asOf, String method) extends Record
Grid carbon intensity per metro, supplied by the caller, with its provenance. This SDK ships no emissions figures: it has no public, citable per-metro source it can stand behind, so the CarbonObjective is inert until a caller gives it a table taken from a source they can cite (a grid operator, a national inventory, a commercial data provider, Equinix sustainability reporting for a specific facility).
  • Field Details

  • Constructor Details

    • CarbonIntensityTable

      public CarbonIntensityTable(Map<String,Double> gramsCo2ePerKwh, String source, String asOf, String method)
      Requires provenance and finite, non-negative figures; normalises metro codes to upper case.
  • Method Details

    • intensity

      public Double intensity(String metro)
      Parameters:
      metro - a metro code
      Returns:
      its intensity, or null when the table has none
    • 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.
    • gramsCo2ePerKwh

      public Map<String,Double> gramsCo2ePerKwh()
      Returns the value of the gramsCo2ePerKwh record component.
      Returns:
      the value of the gramsCo2ePerKwh record component
    • source

      public String source()
      Returns the value of the source record component.
      Returns:
      the value of the source record component
    • asOf

      public String asOf()
      Returns the value of the asOf record component.
      Returns:
      the value of the asOf record component
    • method

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