Class AbstractContextTester
- java.lang.Object
-
- org.eclipse.emf.compare.adapterfactory.context.AbstractContextTester
-
- All Implemented Interfaces:
IContextTester
public abstract class AbstractContextTester extends Object implements IContextTester
An abstract implementation ofIContextTester
that provides convenience methods for retrieving values from the context map.- Since:
- 4.3
-
-
Field Summary
-
Fields inherited from interface org.eclipse.emf.compare.adapterfactory.context.IContextTester
CTX_COMPARISON
-
-
Constructor Summary
Constructors Constructor Description AbstractContextTester()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Comparison
getComparison(Map<Object,Object> context)
Returns the comparison stored under theIContextTester.CTX_COMPARISON
key.protected static <T> T
getValue(Map<Object,Object> context, Object key, Class<T> expectedClass)
Returns the value of the context map stored under the given key, if it is an instance of the given class.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.emf.compare.adapterfactory.context.IContextTester
apply
-
-
-
-
Method Detail
-
getComparison
protected Comparison getComparison(Map<Object,Object> context)
Returns the comparison stored under theIContextTester.CTX_COMPARISON
key.- Parameters:
context
- context map- Returns:
- comparison or null, if no comparison is stored in the context
-
getValue
protected static <T> T getValue(Map<Object,Object> context, Object key, Class<T> expectedClass)
Returns the value of the context map stored under the given key, if it is an instance of the given class.- Type Parameters:
T
- expected type of the value stored under the key- Parameters:
context
- context mapkey
- the key for the context mapexpectedClass
- expected class for the value stored under the key- Returns:
- stored value or null, if no matching value is stored under the key
-
-