Enum DummyWrapper

  • All Implemented Interfaces:
    Serializable, Comparable<DummyWrapper>, TransformerWrapper, ValidatorWrapper

    public enum DummyWrapper
    extends Enum<DummyWrapper>
    implements TransformerWrapper, ValidatorWrapper

    A dummy implementation of the TransformerWrapper and the ValidatorWrapper interfaces.

    This class implements an identity transformation and a validation which always returns valid. It can be used as an application of the null object pattern when no specific transformers or validators are set.

    The class is an enumeration because it is not necessary to create instance; the singleton instance can be shared by all components.

    Version:
    $Id$
    Author:
    Oliver Heger
    • Enum Constant Detail

      • INSTANCE

        public static final DummyWrapper INSTANCE
        The single instance of this class.
    • Method Detail

      • values

        public static DummyWrapper[] 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 (DummyWrapper c : DummyWrapper.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static DummyWrapper 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