public class RegexReplace extends RegexOperation<Pair<java.util.regex.Matcher,TupleEntry>> implements Function<Pair<java.util.regex.Matcher,TupleEntry>>
RegexReplace only expects one field value. If more than one argument value is passed, only the first is handled, the remainder are ignored.
Note a null
valued argument passed to the parser will be converted to an empty string (""
) before
the regex is applied.
Any Object value will be coerced to a String type if type information is provided. See the
CoercibleType
interface to control how custom Object types are converted to String
values.
patternString
fieldDeclaration, numArgs, trace
Constructor and Description |
---|
RegexReplace(Fields fieldDeclaration,
java.lang.String patternString,
java.lang.String replacement)
Constructor RegexReplace creates a new RegexReplace instance.
|
RegexReplace(Fields fieldDeclaration,
java.lang.String patternString,
java.lang.String replacement,
boolean replaceAll)
Constructor RegexReplace creates a new RegexReplace instance,
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object object) |
java.lang.String |
getReplacement() |
int |
hashCode() |
boolean |
isReplaceAll() |
void |
operate(FlowProcess flowProcess,
FunctionCall<Pair<java.util.regex.Matcher,TupleEntry>> functionCall)
Method operate provides the implementation of this Function.
|
void |
prepare(FlowProcess flowProcess,
OperationCall<Pair<java.util.regex.Matcher,TupleEntry>> operationCall)
Method prepare does nothing, and may safely be overridden.
|
getPattern, getPatternString
cleanup, flush, getFieldDeclaration, getNumArgs, getTrace, isSafe, printOperationInternal, toString, toStringInternal
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
cleanup, flush, getFieldDeclaration, getNumArgs, isSafe
@ConstructorProperties(value={"fieldDeclaration","patternString","replacement","replaceAll"}) public RegexReplace(Fields fieldDeclaration, java.lang.String patternString, java.lang.String replacement, boolean replaceAll)
fieldDeclaration
- of type FieldspatternString
- of type Stringreplacement
- of type StringreplaceAll
- of type boolean@ConstructorProperties(value={"fieldDeclaration","patternString","replacement"}) public RegexReplace(Fields fieldDeclaration, java.lang.String patternString, java.lang.String replacement)
fieldDeclaration
- of type FieldspatternString
- of type Stringreplacement
- of type Stringpublic java.lang.String getReplacement()
public boolean isReplaceAll()
public void prepare(FlowProcess flowProcess, OperationCall<Pair<java.util.regex.Matcher,TupleEntry>> operationCall)
BaseOperation
prepare
in interface Operation<Pair<java.util.regex.Matcher,TupleEntry>>
prepare
in class BaseOperation<Pair<java.util.regex.Matcher,TupleEntry>>
public void operate(FlowProcess flowProcess, FunctionCall<Pair<java.util.regex.Matcher,TupleEntry>> functionCall)
Function
operate
in interface Function<Pair<java.util.regex.Matcher,TupleEntry>>
flowProcess
- of type FlowProcessfunctionCall
- of type FunctionCallpublic boolean equals(java.lang.Object object)
equals
in class RegexOperation<Pair<java.util.regex.Matcher,TupleEntry>>
public int hashCode()
hashCode
in class RegexOperation<Pair<java.util.regex.Matcher,TupleEntry>>
Copyright © 2007-2017 Cascading Maintainers. All Rights Reserved.