Record Class PlanDiff

java.lang.Object
java.lang.Record
com.eqixiac.equinix.design.plan.PlanDiff
Record Components:
planId - the plan id compared
deploymentName - the plan's deployment name
projectId - the project searched, or null
resources - one verdict per planned element, in creation order
unmanaged - marked live resources the plan does not contain
notes - read failures and scope caveats
readAt - when the live state was read

public record PlanDiff(String planId, String deploymentName, String projectId, List<ResourceDrift> resources, List<UnmanagedResource> unmanaged, List<String> notes, Instant readAt) extends Record
A plan compared with live state: one ResourceDrift per planned element, the live resources that carry the plan's marker but are not in it, and notes on anything that could not be read.
  • Constructor Details

  • Method Details

    • drift

      public Optional<ResourceDrift> drift(String key)
      The verdict for a key.
      Parameters:
      key - the logical key
      Returns:
      the verdict, or empty when the plan has no such key
    • withStatus

      public List<ResourceDrift> withStatus(DriftStatus status)
      The verdicts with a given status.
      Parameters:
      status - the status
      Returns:
      the matching verdicts, in creation order
    • isInSync

      public boolean isInSync()
      Whether live state matches the plan exactly: nothing missing, different or unreadable, and no unmanaged resource.
      Returns:
      true when in sync
    • toMarkdown

      public String toMarkdown()
      A readable report.
      Returns:
      Markdown
    • 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.
    • planId

      public String planId()
      Returns the value of the planId record component.
      Returns:
      the value of the planId record component
    • deploymentName

      public String deploymentName()
      Returns the value of the deploymentName record component.
      Returns:
      the value of the deploymentName record component
    • projectId

      public String projectId()
      Returns the value of the projectId record component.
      Returns:
      the value of the projectId record component
    • resources

      public List<ResourceDrift> resources()
      Returns the value of the resources record component.
      Returns:
      the value of the resources record component
    • unmanaged

      public List<UnmanagedResource> unmanaged()
      Returns the value of the unmanaged record component.
      Returns:
      the value of the unmanaged record component
    • notes

      public List<String> notes()
      Returns the value of the notes record component.
      Returns:
      the value of the notes record component
    • readAt

      public Instant readAt()
      Returns the value of the readAt record component.
      Returns:
      the value of the readAt record component