Record Class UpgradeResult
java.lang.Object
java.lang.Record
org.apache.maven.cling.invoker.mvnup.goals.UpgradeResult
- Record Components:
processedPoms- the set of POMs that were processedmodifiedPoms- the set of POMs that were modifiederrorPoms- the set of POMs that had errors
public record UpgradeResult(Set<Path> processedPoms, Set<Path> modifiedPoms, Set<Path> errorPoms)
extends Record
Result of an upgrade strategy application.
Uses sets of paths to track which POMs were processed, modified, or had errors,
avoiding double-counting when multiple strategies affect the same POMs.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic UpgradeResultempty()Creates an empty result (no POMs processed).final booleanIndicates whether some other object is "equal to" this one.intReturns the number of POMs that had errors.Returns the value of theerrorPomsrecord component.static UpgradeResultCreates a failure result with the specified processed POMs and error POMs.final inthashCode()Returns a hash code value for this object.merge(UpgradeResult other) Merges this result with another result, combining the sets of POMs.intReturns the number of POMs modified.Returns the value of themodifiedPomsrecord component.intReturns the number of POMs processed.Returns the value of theprocessedPomsrecord component.booleansuccess()Returns true if no errors occurred.static UpgradeResultCreates a successful result with the specified processed and modified POMs.final StringtoString()Returns a string representation of this record class.intReturns the number of POMs that were processed but not modified and had no errors.
-
Constructor Details
-
UpgradeResult
Creates an instance of aUpgradeResultrecord class.- Parameters:
processedPoms- the value for theprocessedPomsrecord componentmodifiedPoms- the value for themodifiedPomsrecord componenterrorPoms- the value for theerrorPomsrecord component
-
-
Method Details
-
success
Creates a successful result with the specified processed and modified POMs. -
failure
Creates a failure result with the specified processed POMs and error POMs. -
empty
Creates an empty result (no POMs processed). -
merge
Merges this result with another result, combining the sets of POMs. This allows proper aggregation of results from multiple strategies without double-counting. -
success
public boolean success()Returns true if no errors occurred. -
processedCount
public int processedCount()Returns the number of POMs processed. -
modifiedCount
public int modifiedCount()Returns the number of POMs modified. -
errorCount
public int errorCount()Returns the number of POMs that had errors. -
unmodifiedCount
public int unmodifiedCount()Returns the number of POMs that were processed but not modified and had no errors. -
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). -
processedPoms
Returns the value of theprocessedPomsrecord component.- Returns:
- the value of the
processedPomsrecord component
-
modifiedPoms
Returns the value of themodifiedPomsrecord component.- Returns:
- the value of the
modifiedPomsrecord component
-
errorPoms
-