Enum OpMode

java.lang.Object
java.lang.Enum<OpMode>
com.bazaarvoice.jolt.modifier.OpMode
All Implemented Interfaces:
Serializable, Comparable<OpMode>

public enum OpMode extends Enum<OpMode>
OpMode differentiates different flavors of Templatr Templatr can fill in leaf values as required in spec from a specified context, self or a hardcoded default value. However whether or not that 'write' operation should go through, is determined by this enum. All of these opModes validates if the if the source (map or list) and the key/index are valid, i.e. not null or >= 0, etc. OVERWRITR always writes DEFAULTR only writes when the the value at the key/index is null DEFINR only writes when source does not contain the key/index
  • Enum Constant Details

    • OVERWRITR

      public static final OpMode OVERWRITR
    • DEFAULTR

      public static final OpMode DEFAULTR
    • DEFINER

      public static final OpMode DEFINER
  • Field Details

    • op

      private String op
      Identifier OP prefix that is defined in SPEC
    • opModeMap

      private static Map<String,OpMode> opModeMap
      Static validity checker and instance getter from given op String
  • Constructor Details

    • OpMode

      private OpMode(String op)
  • Method Details

    • values

      public static OpMode[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static OpMode 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
    • getOp

      public String getOp()
    • toString

      public String toString()
      Overrides:
      toString in class Enum<OpMode>
    • isApplicable

      public boolean isApplicable(Map source, String key)
      Given a source map and a input key returns true if it is ok to go ahead with write operation given a specific opMode
    • isApplicable

      public boolean isApplicable(List source, int reqIndex, int origSize)
      Given a source list and a input index and original size of the list (when passed in as input) returns true if it is ok to go ahead with write operation given a specific opMode
    • isValid

      public static boolean isValid(String op)
    • from

      public static OpMode from(String op)