Class ReplaceGlobalStep<S,E>

All Implemented Interfaces:
Serializable, Cloneable, Iterator<Traverser.Admin<E>>, Step<S,E>

public final class ReplaceGlobalStep<S,E> extends ScalarMapStep<S,E>
Reference implementation for substring step, a mid-traversal step which returns a string with the specified characters in the original string replaced with the new characters. Any null arguments will be a no-op and the original string is returned. Null values are not processed and remain as null when returned. If the incoming traverser is a non-String value then an IllegalArgumentException will be thrown.
Author:
David Bechberger (http://bechberger.com), Yang Xia (http://github.com/xiazcy)
See Also:
  • Constructor Details

  • Method Details

    • map

      protected E map(Traverser.Admin<S> traverser)
      Specified by:
      map in class ScalarMapStep<S,E>
    • getRequirements

      public Set<TraverserRequirement> getRequirements()
      Description copied from interface: Step
      Provide the necessary TraverserRequirement that must be met by the traverser in order for the step to function properly. The provided default implements returns an empty set.
      Returns:
      the set of requirements
    • getOldChar

      public String getOldChar()
    • getNewChar

      public String getNewChar()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class AbstractStep<S,E>