Record Class DesignObjectives

java.lang.Object
java.lang.Record
com.eqixiac.equinix.design.spec.DesignObjectives
Record Components:
profile - a named weight profile to start from (for example balanced, latency_first, cost_first, redundancy_first, provider_coverage_first); may be null
weights - explicit weights by objective id, applied on top of profile; never null

public record DesignObjectives(String profile, Map<String,Double> weights) extends Record
What "better" means for this design: a weight per objective id. Weights are relative (they are normalised to sum to 1) and only objectives with a positive weight influence the recommended option; every evaluated objective is still reported so trade-offs are visible.

Built-in objective ids are the constants on com.eqixiac.equinix.design.spi.Objective (latency, cost, provider_coverage, resilience, compliance); a plug-in objective is weighted by its own id (for example carbon).

  • Constructor Details

    • DesignObjectives

      public DesignObjectives(String profile, Map<String,Double> weights)
      Normalises weights to an immutable, non-null, insertion-ordered map.
  • Method Details

    • balanced

      public static DesignObjectives balanced()
      Returns:
      the balanced profile with no overrides
    • 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.
    • profile

      public String profile()
      Returns the value of the profile record component.
      Returns:
      the value of the profile record component
    • weights

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