Record Class PreflightResult

java.lang.Object
java.lang.Record
network.ike.plugin.ws.preflight.PreflightResult

public record PreflightResult(List<PreflightResult.Failure> failures) extends Record
Outcome of a preflight run. Collects any per-condition failures and lets the caller decide how to react (hard-fail for publish mojos, warn-only for their draft siblings).

See Preflight.of(List, PreflightContext).

  • Constructor Details

    • PreflightResult

      public PreflightResult(List<PreflightResult.Failure> failures)
      Creates an instance of a PreflightResult record class.
      Parameters:
      failures - the value for the failures record component
  • Method Details

    • passed

      public boolean passed()
      True if every condition passed.
    • requirePassed

      public void requirePassed(WsGoal goal) throws org.apache.maven.api.plugin.MojoException
      Hard-fail contract for publish mojos. Throws MojoException with an aggregated, user-facing message if any condition failed.
      Parameters:
      goal - the publish goal running the preflight — used in the error header so the user sees which goal is refusing to proceed
      Throws:
      org.apache.maven.api.plugin.MojoException - if any condition failed
    • warnIfFailed

      public void warnIfFailed(org.apache.maven.api.plugin.Log log, WsGoal goal)
      Soft-fail contract for draft mojos. Emits a warning per failing condition but does not throw, so the user can still preview the operation's plan.
      Parameters:
      log - Maven logger
      goal - the publish goal whose preflight this would block — named in the warning so the user knows what would fail
    • 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.
    • failures

      public List<PreflightResult.Failure> failures()
      Returns the value of the failures record component.
      Returns:
      the value of the failures record component