public class FieldReplacer extends Object
Constructor and Description |
---|
FieldReplacer(String fieldName,
String pattern,
String replacement,
Integer flags)
Field replacer with the input and output field the same.
|
FieldReplacer(String fieldName,
String toFieldName,
String pattern,
String replacement,
Integer flags)
Create a FieldReplacer for a field.
|
Modifier and Type | Method and Description |
---|---|
String |
checkAndReplace(String fieldName,
String value)
Return a replacement value for a field.
|
String |
getFieldName() |
Pattern |
getPattern() |
String |
getReplacement() |
String |
getToFieldName() |
boolean |
isValid()
Does this FieldReplacer have a valid fieldname and pattern?
|
String |
replace(String value)
Return the replacement value for a field value.
|
public FieldReplacer(String fieldName, String toFieldName, String pattern, String replacement, Integer flags)
fieldName
- the name of the source field to operate on. Required.toFieldName
- the name of the target field. Required.pattern
- the pattern the field must match. Required.replacement
- the replacement stringflags
- the Pattern flags value, or null if no flags are neededpublic String getFieldName()
public String getToFieldName()
public Pattern getPattern()
public String getReplacement()
public boolean isValid()
public String replace(String value)
value
- public String checkAndReplace(String fieldName, String value)
fieldName
- the name of the field you are checkingvalue
- the value of the field you are checkingCopyright © 2021 The Apache Software Foundation