Class ContextUtil
- java.lang.Object
-
- org.eclipse.emf.compare.internal.adapterfactory.context.ContextUtil
-
public final class ContextUtil extends Object
Utility class for evaluating context testers in adapter factory descriptors.- Since:
- 4.3
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanapply(ComposedAdapterFactory.Descriptor adapterFactoryDescriptor, Map<Object,Object> context)Returns whether the adapter factory should be applied in the given context.static booleanisNullContext(Map<Object,Object> context)Evaluates whether the given context is a null context, i.e., the context itself is null, it has no entries or all its values are null.
-
-
-
Method Detail
-
apply
public static boolean apply(ComposedAdapterFactory.Descriptor adapterFactoryDescriptor, Map<Object,Object> context)
Returns whether the adapter factory should be applied in the given context.- Parameters:
adapterFactoryDescriptor- theComposedAdapterFactory.Descriptorcontaining the adapter factory and possibly a context testercontext- the context- Returns:
falseif the descriptor's context tester indicates no responsibility for the givencomparison,trueotherwise.- See Also:
IContextTester.apply(Map)
-
isNullContext
public static boolean isNullContext(Map<Object,Object> context)
Evaluates whether the given context is a null context, i.e., the context itself is null, it has no entries or all its values are null.- Parameters:
context- the context- Returns:
trueif the context is null, empty or all its values are null,falseotherwise.
-
-