Class NullInvocation

  • All Implemented Interfaces:
    Invokable

    @Deprecated
    public final class NullInvocation
    extends Object
    implements Invokable
    Deprecated.
    Use HelperInvocations instead; it provides some dummy implementations of the Invokable interface which are useful in some situations where a full-blown implementation is not required.

    A dummy implementation of the Invokable interface that does not perform any action when it is invoked.

    This class (or the default instance provided through the INSTANCE constant) can be used as a default place holder for an Invokable object. All methods are dummy implementations that have no side effect. So instead of checking for a null Invokable reference, this dummy invocation can be used.

    Version:
    $Id: NullInvocation.java 208 2012-02-11 20:57:33Z oheger $
    Author:
    Oliver Heger
    • Field Detail

      • INSTANCE

        public static final NullInvocation INSTANCE
        Deprecated.
        The default instance of this class.
    • Constructor Detail

      • NullInvocation

        public NullInvocation()
        Deprecated.
    • Method Detail

      • getParameterDependencies

        public List<Dependency> getParameterDependencies()
        Deprecated.
        Returns the dependencies of this Invokable. This is always an empty list.
        Specified by:
        getParameterDependencies in interface Invokable
        Returns:
        the dependencies of this object
      • invoke

        public Object invoke​(DependencyProvider depProvider,
                             Object target)
        Deprecated.
        Invokes this Invokable. This is just an empty dummy.
        Specified by:
        invoke in interface Invokable
        Parameters:
        depProvider - the dependency provider
        target - the target object
        Returns:
        the result of the invocation, which is always null in this case
      • toString

        public String toString()
        Deprecated.
        Returns a string representation of this object. This implementation just returns the text <no initializer>.
        Overrides:
        toString in class Object
        Returns:
        a string for this object