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 UpgradeResult
empty()
Creates an empty result (no POMs processed).final boolean
Indicates whether some other object is "equal to" this one.int
Returns the number of POMs that had errors.Returns the value of theerrorPoms
record component.static UpgradeResult
Creates a failure result with the specified processed POMs and error POMs.final int
hashCode()
Returns a hash code value for this object.merge
(UpgradeResult other) Merges this result with another result, combining the sets of POMs.int
Returns the number of POMs modified.Returns the value of themodifiedPoms
record component.int
Returns the number of POMs processed.Returns the value of theprocessedPoms
record component.boolean
success()
Returns true if no errors occurred.static UpgradeResult
Creates a successful result with the specified processed and modified POMs.final String
toString()
Returns a string representation of this record class.int
Returns the number of POMs that were processed but not modified and had no errors.
-
Constructor Details
-
UpgradeResult
Creates an instance of aUpgradeResult
record class.- Parameters:
processedPoms
- the value for theprocessedPoms
record componentmodifiedPoms
- the value for themodifiedPoms
record componenterrorPoms
- the value for theerrorPoms
record 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 theprocessedPoms
record component.- Returns:
- the value of the
processedPoms
record component
-
modifiedPoms
Returns the value of themodifiedPoms
record component.- Returns:
- the value of the
modifiedPoms
record component
-
errorPoms
-