Record Class NexusOutcome

java.lang.Object
java.lang.Record
network.ike.plugin.release.nexus.NexusOutcome
Record Components:
succeeded - whether the Nexus deploy completed successfully
attempts - number of attempts made (zero before the first try)
skipReason - human-readable reason if the phase was skipped, or null when not skipped

public record NexusOutcome(boolean succeeded, int attempts, String skipReason) extends Record
Outcome of the Nexus deploy phase in the release pipeline.

Tracks attempt count, success state, and an optional skip reason (non-null when the phase was deliberately bypassed via the ike.skipNexusDeploy parameter or because credentials were unavailable). Read by the post-deploy log and the release-report renderer; not consumed downstream by the cascade itself.

Instances are immutable. Callers update state by constructing a new instance via the with* helpers. initial() returns the "did not run" state — appropriate for a draft preview or a release aborted before the deploy phase.

Carved out of ReleaseDraftMojo during the Phase 4 decomposition (IKE-Network/ike-issues#489 P1) so that downstream commits can replace mojo fields with phase-returned outcomes without further reshaping.

  • Constructor Details

    • NexusOutcome

      public NexusOutcome(boolean succeeded, int attempts, String skipReason)
      Creates an instance of a NexusOutcome record class.
      Parameters:
      succeeded - the value for the succeeded record component
      attempts - the value for the attempts record component
      skipReason - the value for the skipReason record component
  • Method Details

    • initial

      public static NexusOutcome initial()
      Returns the initial outcome — not succeeded, zero attempts, no skip reason.
      Returns:
      the initial NexusOutcome
    • withAttempts

      public NexusOutcome withAttempts(int attempts)
      Returns a copy of this outcome with the attempt count replaced.
      Parameters:
      attempts - the new attempt count
      Returns:
      a new NexusOutcome with the updated attempt count
    • withSucceeded

      public NexusOutcome withSucceeded(boolean succeeded)
      Returns a copy of this outcome with the success flag replaced.
      Parameters:
      succeeded - the new success flag
      Returns:
      a new NexusOutcome with the updated success flag
    • withSkipReason

      public NexusOutcome withSkipReason(String skipReason)
      Returns a copy of this outcome with the skip reason replaced.
      Parameters:
      skipReason - the new skip reason, or null to clear
      Returns:
      a new NexusOutcome with the updated skip reason
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • succeeded

      public boolean succeeded()
      Returns the value of the succeeded record component.
      Returns:
      the value of the succeeded record component
    • attempts

      public int attempts()
      Returns the value of the attempts record component.
      Returns:
      the value of the attempts record component
    • skipReason

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