Class AbstractContextTester

  • All Implemented Interfaces:
    IContextTester

    public abstract class AbstractContextTester
    extends Object
    implements IContextTester
    An abstract implementation of IContextTester that provides convenience methods for retrieving values from the context map.
    Since:
    4.3
    • Constructor Detail

      • AbstractContextTester

        public AbstractContextTester()
    • Method Detail

      • 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 map
        key - the key for the context map
        expectedClass - expected class for the value stored under the key
        Returns:
        stored value or null, if no matching value is stored under the key