Class BaseContext

    • Constructor Detail

      • BaseContext

        public BaseContext()
        Creates an empty context.
      • BaseContext

        public BaseContext​(Map<String,​Object> properties)
        Creates a BaseContext object and copy a map of properties.
        Parameters:
        properties - the map of properties to copy.
    • Method Detail

      • getString

        public String getString​(String name)
        Description copied from interface: IContext
        Gets a string property of this context.
        Specified by:
        getString in interface IContext
        Parameters:
        name - the name of the property to retrieve.
        Returns:
        the value of the property or null if it not defined.
      • setString

        public void setString​(String name,
                              String value)
        Description copied from interface: IContext
        Sets a string property for this context. If the property is already defined its value will be overwritten.
        Specified by:
        setString in interface IContext
        Parameters:
        name - the name of the property to set.
        value - the value to set.
      • getBoolean

        public boolean getBoolean​(String name)
        Description copied from interface: IContext
        Gets a boolean property of this context.
        Specified by:
        getBoolean in interface IContext
        Parameters:
        name - the name of the property to retrieve.
        Returns:
        the value of the property or false if it is not defined.
      • setBoolean

        public void setBoolean​(String name,
                               boolean value)
        Description copied from interface: IContext
        Sets a boolean property for this context. If the property is already defined its value will be overwritten.
        Specified by:
        setBoolean in interface IContext
        Parameters:
        name - the name of the property to set.
        value - the value to set.
      • getInteger

        public int getInteger​(String name)
        Description copied from interface: IContext
        Gets an integer property of this context.
        Specified by:
        getInteger in interface IContext
        Parameters:
        name - the name of the property to retrieve.
        Returns:
        the value of the property or 0 if it is not defined.
      • setInteger

        public void setInteger​(String name,
                               int value)
        Description copied from interface: IContext
        Sets an integer property for this context. If the property is already defined its value will be overwritten.
        Specified by:
        setInteger in interface IContext
        Parameters:
        name - the name of the property to set.
        value - the value to set.
      • getObject

        public Object getObject​(String name)
        Description copied from interface: IContext
        Gets an object property of this context.
        Specified by:
        getObject in interface IContext
        Parameters:
        name - the name of the property to retrieve.
        Returns:
        the value of the property or null if it is not defined.
      • setObject

        public void setObject​(String name,
                              Object value)
        Description copied from interface: IContext
        Sets an object property for this context. If the property is already defined its value will be overwritten.
        Specified by:
        setObject in interface IContext
        Parameters:
        name - the name of the property to set.
        value - the value to set.
      • removeProperty

        public void removeProperty​(String name)
        Description copied from interface: IContext
        Removes a given property from this context. If the property does not exist nothing happens.
        Specified by:
        removeProperty in interface IContext
        Parameters:
        name - the name of the property to remove.
      • getProperties

        public Map<String,​Object> getProperties()
        Description copied from interface: IContext
        Gets the map of the existing properties for this context.
        Specified by:
        getProperties in interface IContext
        Returns:
        the map of the properties for this context. May be empty but not null.
      • clearProperties

        public void clearProperties()
        Description copied from interface: IContext
        Removes all properties from this context.
        Specified by:
        clearProperties in interface IContext
      • getAnnotation

        public <A extends IAnnotation> A getAnnotation​(Class<A> type)
        Description copied from interface: IContext
        Gets the annotation of a given type for this context.
        Specified by:
        getAnnotation in interface IContext
        Type Parameters:
        A - the class type.
        Parameters:
        type - the type of the annotation to retrieve.
        Returns:
        the annotation for the given type, or null if it is not defined.
      • setAnnotation

        public void setAnnotation​(IAnnotation annotation)
        Description copied from interface: IContext
        Sets an annotation for this context.
        Specified by:
        setAnnotation in interface IContext
        Parameters:
        annotation - the annotation to set. If one of this type already exists it will be overwritten.
      • clearAnnotations

        public void clearAnnotations()
        Description copied from interface: IContext
        Removes all annotations from this context.
        Specified by:
        clearAnnotations in interface IContext