org.apache.commons.configuration2.interpol

## Enum DummyLookup

- java.lang.Object
- - java.lang.Enum<DummyLookup>
  - - org.apache.commons.configuration2.interpol.DummyLookup

- All Implemented Interfaces:
    Serializable, Comparable<DummyLookup>, Lookup

      public enum DummyLookup
      extends Enum<DummyLookup>
      implements Lookup

  A simple dummy `Lookup` implementation.

  This implementation always returns null for a passed in variable indicating that it cannot resolve that variable. This is useful for instance as an application of the null object pattern.

  This class does not define any state, therefore a single instance can be shared. To enforce usage of only a single instance this class is actually an enumeration.

  Since:
    2.0

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `INSTANCE` The single instance of this class.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `lookup(String variable)` Looks up the value of the specified variable.
    `static DummyLookup` | `valueOf(String name)` Returns the enum constant of this type with the specified name.
    `static DummyLookup[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

    - ### Methods inherited from class java.lang.Enum

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### INSTANCE

          public static final DummyLookup INSTANCE

      The single instance of this class.

  - ### Method Detail

    - #### values

          public static DummyLookup[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (DummyLookup c : DummyLookup.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static DummyLookup valueOf(String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
        `name` - the name of the enum constant to be returned.
      Returns:
        the enum constant with the specified name
      Throws:
        `IllegalArgumentException` - if this enum type has no constant with the specified name
        `NullPointerException` - if the argument is null

    - #### lookup

          public Object lookup(String variable)

      Looks up the value of the specified variable. This method is called by `ConfigurationInterpolator` with the variable name extracted from the expression to interpolate (i.e. the prefix name has already been removed). A concrete implementation has to return the value of this variable or null if the variable name is unknown. This implementation always returns null.
      Specified by:
        `lookup` in interface `Lookup`
      Parameters:
        `variable` - the name of the variable to be resolved
      Returns:
        the value of this variable or null

Copyright © 2001–2022 The Apache Software Foundation. All rights reserved.