Class ForwardingContext

  • All Implemented Interfaces:
    Context

    public abstract class ForwardingContext
    extends Object
    implements Context
    Forwarding implementation of Context
    Author:
    Jozef Hartinger
    • Constructor Detail

      • ForwardingContext

        public ForwardingContext()
    • Method Detail

      • delegate

        protected abstract Context delegate()
      • getScope

        public Class<? extends Annotation> getScope()
        Description copied from interface: Context
        Get the scope type of the context object.
        Specified by:
        getScope in interface Context
        Returns:
        the scope
      • get

        public <T> T get​(Contextual<T> contextual,
                         CreationalContext<T> creationalContext)
        Description copied from interface: Context
        Return an existing instance of certain contextual type or create a new instance by calling Contextual.create(CreationalContext) and return the new instance.
        Specified by:
        get in interface Context
        Type Parameters:
        T - the type of contextual type
        Parameters:
        contextual - the contextual type
        creationalContext - the context in which the new instance will be created
        Returns:
        the contextual instance
      • get

        public <T> T get​(Contextual<T> contextual)
        Description copied from interface: Context
        Return an existing instance of a certain contextual type or a null value.
        Specified by:
        get in interface Context
        Type Parameters:
        T - the type of the contextual type
        Parameters:
        contextual - the contextual type
        Returns:
        the contextual instance, or a null value
      • isActive

        public boolean isActive()
        Description copied from interface: Context
        Determines if the context object is active.
        Specified by:
        isActive in interface Context
        Returns:
        true if the context is active, or false otherwise.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object