Record Class PreflightResult
java.lang.Object
java.lang.Record
network.ike.plugin.ws.preflight.PreflightResult
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).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA single failing condition with the remediation it emitted. -
Constructor Summary
ConstructorsConstructorDescriptionPreflightResult(List<PreflightResult.Failure> failures) Creates an instance of aPreflightResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.failures()Returns the value of thefailuresrecord component.final inthashCode()Returns a hash code value for this object.booleanpassed()True if every condition passed.voidrequirePassed(WsGoal goal) Hard-fail contract for publish mojos.final StringtoString()Returns a string representation of this record class.voidwarnIfFailed(org.apache.maven.api.plugin.Log log, WsGoal goal) Soft-fail contract for draft mojos.
-
Constructor Details
-
PreflightResult
Creates an instance of aPreflightResultrecord class.- Parameters:
failures- the value for thefailuresrecord component
-
-
Method Details
-
passed
public boolean passed()True if every condition passed. -
requirePassed
Hard-fail contract for publish mojos. ThrowsMojoExceptionwith 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
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 loggergoal- the publish goal whose preflight this would block — named in the warning so the user knows what would fail
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object). -
failures
Returns the value of thefailuresrecord component.- Returns:
- the value of the
failuresrecord component
-