Package com.bazaarvoice.jolt.modifier
Enum OpMode
- All Implemented Interfaces:
Serializable
,Comparable<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 Summary
Enum Constants -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic OpMode
getOp()
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 opModeboolean
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 opModestatic boolean
toString()
static OpMode
Returns the enum constant of this type with the specified name.static OpMode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
OVERWRITR
-
DEFAULTR
-
DEFINER
-
-
Field Details
-
op
Identifier OP prefix that is defined in SPEC -
opModeMap
Static validity checker and instance getter from given op String
-
-
Constructor Details
-
OpMode
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
getOp
-
toString
-
isApplicable
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
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
-
from
-