Package org.eclipse.emf.compare.utils
Class EMFCompareJavaPredicates
java.lang.Object
org.eclipse.emf.compare.utils.EMFCompareJavaPredicates
public final class EMFCompareJavaPredicates
extends java.lang.Object
This class will provide a number of Predicates that can be used to retrieve particular
Diffs from
an iterable.-
Constructor Summary
Constructors Constructor Description EMFCompareJavaPredicates() -
Method Summary
Modifier and Type Method Description static java.util.function.Predicate<? super Diff>ofKind(DifferenceKind... kind)This predicate can be used to check whether a particular diff is of the givenkind.static java.util.function.Predicate<Diff>onFeature(EStructuralFeature feature)Accept only diffs that inherit either AttributeChange, ReferenceChange, or FeatureMapChange that concern the given feature.static java.util.function.Predicate<Diff>possiblyConflictingWith(Diff diff)Predicate builder for diffs that can conflict with the given diff.static java.util.function.Predicate<Diff>valueMatches(IEqualityHelper helper, java.lang.Object value)Accept only diffs whose value matches the given value.
-
Constructor Details
-
EMFCompareJavaPredicates
public EMFCompareJavaPredicates()
-
-
Method Details
-
possiblyConflictingWith
Predicate builder for diffs that can conflict with the given diff.- Parameters:
diff- The diff- Returns:
- A predicate that accepts diffs that might conflict with the given diff.
-
ofKind
This predicate can be used to check whether a particular diff is of the givenkind. This is mainly used to differentiate additions from deletions.- Parameters:
kind- The kind we expect this diff to have.- Returns:
- The created predicate.
-
onFeature
Accept only diffs that inherit either AttributeChange, ReferenceChange, or FeatureMapChange that concern the given feature.- Parameters:
feature- Feature to deal with- Returns:
- a new predicate that accepts diffs that concern the given feature.
-
valueMatches
public static java.util.function.Predicate<Diff> valueMatches(IEqualityHelper helper, java.lang.Object value)Accept only diffs whose value matches the given value.- Parameters:
helper- The helper to match valuesvalue- The value to match- Returns:
- The created predicate.
-