cascading.operation.regex

## Class RegexFilter

- java.lang.Object
- - cascading.operation.BaseOperation<C>
  - - cascading.operation.regex.RegexOperation<java.util.regex.Matcher>
    - - cascading.operation.regex.RegexMatcher
      - - cascading.operation.regex.RegexFilter

- All Implemented Interfaces:
    DeclaresResults, Filter<java.util.regex.Matcher>, Operation<java.util.regex.Matcher>, Traceable, java.io.Serializable

      public class RegexFilter
      extends RegexMatcher
      implements Filter<java.util.regex.Matcher>

  Class RegexFilter will apply the regex patternString against every input Tuple value and filter the Tuple stream accordingly.

  By default, Tuples that match the given pattern are kept, and Tuples that do not match are filtered out. This can be changed by setting removeMatch to true.

  Also, by default, the whole Tuple is matched against the given patternString (tab delimited, unless otherwise specified). If matchEachElement is set to true, the pattern is applied to each Tuple value individually.

  This operation uses `Matcher` internally, specifically the method `Matcher.find()`.

  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 via any provided `CoercibleType` on the argument selector or via its `toString()` method.
  See Also:
    `Matcher`, `Pattern`, Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected boolean` | `matchEachElement` Field matchEachElement

    - ### Fields inherited from class cascading.operation.regex.RegexMatcher

      `DEFAULT_DELIM, delimiter, negateMatch`

    - ### Fields inherited from class cascading.operation.regex.RegexOperation

      `patternString`

    - ### Fields inherited from class cascading.operation.BaseOperation

      `fieldDeclaration, numArgs, trace`

    - ### Fields inherited from interface cascading.operation.Operation

      `ANY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RegexFilter(java.lang.String patternString)` Constructor RegexFilter creates a new RegexFilter instance.
    `RegexFilter(java.lang.String patternString, boolean removeMatch)` Constructor RegexFilter creates a new RegexFilter instance.
    `RegexFilter(java.lang.String patternString, boolean removeMatch, boolean matchEachElement)`
    `RegexFilter(java.lang.String patternString, boolean removeMatch, boolean matchEachElement, java.lang.String delimiter)`
    `RegexFilter(java.lang.String patternString, boolean removeMatch, java.lang.String delimiter)` Constructor RegexFilter creates a new RegexFilter instance.
    `RegexFilter(java.lang.String patternString, java.lang.String delimiter)` Constructor RegexFilter creates a new RegexFilter instance.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object object)`
    `int` | `hashCode()`
    `boolean` | `isMatchEachElement()`
    `boolean` | `isRemove(FlowProcess flowProcess, FilterCall<java.util.regex.Matcher> filterCall)` Method isRemove returns true if input should be removed from the tuple stream.

    - ### Methods inherited from class cascading.operation.regex.RegexMatcher

      `getDelimiter, isNegateMatch, matchEachElement, matchEachElementPos, matchWholeTuple, prepare`

    - ### Methods inherited from class cascading.operation.regex.RegexOperation

      `getPattern, getPatternString`

    - ### Methods inherited from class cascading.operation.BaseOperation

      `cleanup, flush, getFieldDeclaration, getNumArgs, getTrace, isSafe, printOperationInternal, toString, toStringInternal`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface cascading.operation.Operation

      `cleanup, flush, getFieldDeclaration, getNumArgs, isSafe, prepare`

- - ### Field Detail

    - #### matchEachElement

          protected final boolean matchEachElement

      Field matchEachElement

  - ### Constructor Detail

    - #### RegexFilter

          @ConstructorProperties(value="patternString")
          public RegexFilter(java.lang.String patternString)

      Constructor RegexFilter creates a new RegexFilter instance.
      Parameters:
        `patternString` - of type String

    - #### RegexFilter

          @ConstructorProperties(value={"patternString","delimiter"})
          public RegexFilter(java.lang.String patternString,
                                           java.lang.String delimiter)

      Constructor RegexFilter creates a new RegexFilter instance.
      Parameters:
        `patternString` - of type String
        `delimiter` - of type String

    - #### RegexFilter

          @ConstructorProperties(value={"patternString","removeMatch"})
          public RegexFilter(java.lang.String patternString,
                                           boolean removeMatch)

      Constructor RegexFilter creates a new RegexFilter instance.
      Parameters:
        `patternString` - of type String
        `removeMatch` - of type boolean

    - #### RegexFilter

          @ConstructorProperties(value={"patternString","removeMatch","delimiter"})
          public RegexFilter(java.lang.String patternString,
                                           boolean removeMatch,
                                           java.lang.String delimiter)

      Constructor RegexFilter creates a new RegexFilter instance.
      Parameters:
        `patternString` - of type String
        `removeMatch` - of type boolean
        `delimiter` - of type String

    - #### RegexFilter

          @ConstructorProperties(value={"patternString","removeMatch","matchEachElement"})
          public RegexFilter(java.lang.String patternString,
                                           boolean removeMatch,
                                           boolean matchEachElement)

      Parameters:
        `patternString` - of type String
        `removeMatch` - of type boolean, set to true if a match should be filtered
        `matchEachElement` - of type boolean, set to true if each element should be matched individually

    - #### RegexFilter

          @ConstructorProperties(value={"patternString","removeMatch","matchEachElement","delimiter"})
          public RegexFilter(java.lang.String patternString,
                                           boolean removeMatch,
                                           boolean matchEachElement,
                                           java.lang.String delimiter)

      Parameters:
        `patternString` - of type String
        `removeMatch` - of type boolean, set to true if a match should be filtered
        `matchEachElement` - of type boolean, set to true if each element should be matched individually
        `delimiter` - of type String

  - ### Method Detail

    - #### isMatchEachElement

          public boolean isMatchEachElement()

    - #### isRemove

          public boolean isRemove(FlowProcess flowProcess,
                         FilterCall<java.util.regex.Matcher> filterCall)

      Description copied from interface: `Filter`
      Method isRemove returns true if input should be removed from the tuple stream.
      Specified by:
        `isRemove` in interface `Filter<java.util.regex.Matcher>`
      Parameters:
        `flowProcess` - of type FlowProcess
        `filterCall` - of type FilterCall
      Returns:
        boolean

    - #### equals

          public boolean equals(java.lang.Object object)

      Overrides:
        `equals` in class `RegexMatcher`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `RegexMatcher`

Copyright © 2007-2015 Xplenty, Inc. All Rights Reserved.