Package org.revapi
Class TransformationResult
- java.lang.Object
-
- org.revapi.TransformationResult
-
public final class TransformationResult extends Object
The result of an transformation. The result might or might not be resolved when theDifferenceTransform.tryTransform(Element, Element, Difference)
is called.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TransformationResult.Resolution
The resolution of the difference transformation
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TransformationResult
discard()
boolean
equals(Object o)
Set<Difference>
getDifferences()
The difference passed to theDifferenceTransform.tryTransform(Element, Element, Difference)
method will be replaced by the differences returned from this method.TransformationResult.Resolution
getResolution()
int
hashCode()
static TransformationResult
keep()
static TransformationResult
replaceWith(Set<Difference> newDifferences)
static TransformationResult
replaceWith(Difference newDifference)
Same asreplaceWith(Set)
only for replacing with just a single difference.static TransformationResult
undecided()
-
-
-
Method Detail
-
keep
public static TransformationResult keep()
- Returns:
- result to keep the difference as is
-
discard
public static TransformationResult discard()
- Returns:
- result to discard the difference
-
undecided
public static TransformationResult undecided()
- Returns:
- result to retry the transformation later due to lack of information at the moment
-
replaceWith
public static TransformationResult replaceWith(Set<Difference> newDifferences)
- Parameters:
newDifferences
- the new set of differences to replace the old with- Returns:
- result to replace the difference with new ones
-
replaceWith
public static TransformationResult replaceWith(Difference newDifference)
Same asreplaceWith(Set)
only for replacing with just a single difference.- Parameters:
newDifference
- the difference to transform the original difference to- Returns:
- the transformation result
-
getResolution
public TransformationResult.Resolution getResolution()
- Returns:
- true if the transformation was resolved, false otherwise
-
getDifferences
public Set<Difference> getDifferences()
The difference passed to theDifferenceTransform.tryTransform(Element, Element, Difference)
method will be replaced by the differences returned from this method.This method only returns meaningful data when the resolution is
TransformationResult.Resolution.REPLACE
.
-
-