Record Class GraphNode

java.lang.Object
java.lang.Record
com.eqixiac.equinix.design.resilience.GraphNode
Record Components:
id - stable id, unique in the graph (for example metro:DC, onramp:aws@DC)
kind - what the node stands for
label - readable name
metro - the metro code the node is located in (metros, routers, on-ramps), or null
region - the Equinix region of metro, or null when unknown or not located
cloudId - the spec cloud id (on-ramps and clouds), or null
geoZones - the metro's Fabric geo scopes / zones as the catalogue reports them (metros only); never null
weight - a site's share of the total site weight (0..1); null for other nodes
providerRegion - for a cloud, PROVIDER region when the spec names its region (clouds sharing it share fate); null otherwise

public record GraphNode(String id, NodeKind kind, String label, String metro, Region region, String cloudId, Set<String> geoZones, Double weight, String providerRegion) extends Record
One node of a DesignGraph.
  • Constructor Details

    • GraphNode

      public GraphNode(String id, NodeKind kind, String label, String metro, Region region, String cloudId, Set<String> geoZones, Double weight, String providerRegion)
      Requires an id and a kind; makes geoZones immutable, sorted and non-null.
    • GraphNode

      public GraphNode(String id, NodeKind kind, String label, String metro, Region region, String cloudId, Set<String> geoZones, Double weight)
      A node with no provider region.
      Parameters:
      id - the id
      kind - the kind
      label - the label
      metro - the metro code, or null
      region - the region, or null
      cloudId - the cloud id, or null
      geoZones - the zones, or null
      weight - the site weight, or null
  • 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. 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.
    • id

      public String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • kind

      public NodeKind kind()
      Returns the value of the kind record component.
      Returns:
      the value of the kind record component
    • label

      public String label()
      Returns the value of the label record component.
      Returns:
      the value of the label record component
    • metro

      public String metro()
      Returns the value of the metro record component.
      Returns:
      the value of the metro record component
    • region

      public Region region()
      Returns the value of the region record component.
      Returns:
      the value of the region record component
    • cloudId

      public String cloudId()
      Returns the value of the cloudId record component.
      Returns:
      the value of the cloudId record component
    • geoZones

      public Set<String> geoZones()
      Returns the value of the geoZones record component.
      Returns:
      the value of the geoZones record component
    • weight

      public Double weight()
      Returns the value of the weight record component.
      Returns:
      the value of the weight record component
    • providerRegion

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