Class ReplaceStringTransformer

  • All Implemented Interfaces:
    com.google.common.base.Function<Exchange,​Exchange>, java.util.function.Function<Exchange,​Exchange>

    public class ReplaceStringTransformer
    extends java.lang.Object
    implements com.google.common.base.Function<Exchange,​Exchange>
    Transform an exchange into a new one by replacing all string pattern occurences in URL, headers and body.
    Author:
    https://github.com/lbovet [Laurent Bovet]
    • Constructor Summary

      Constructors 
      Constructor Description
      ReplaceStringTransformer​(java.lang.String pattern, java.lang.String with)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Exchange apply​(Exchange exchange)  
      static ReplaceStringTransformer clearTimestamps()
      Predefined transformer replacing all timestamps with the epoch (1970-01-01T00:00:00Z).
      static ReplaceStringTransformer clearUUIDs()
      Predefined transformer placing all UUIDs with a blank one (00000000-0000-0000-0000-000000000000).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface com.google.common.base.Function

        equals
      • Methods inherited from interface java.util.function.Function

        andThen, compose
    • Constructor Detail

      • ReplaceStringTransformer

        public ReplaceStringTransformer​(java.lang.String pattern,
                                        java.lang.String with)
        Parameters:
        pattern - Matches the string to replace.
        with - String used as substitution.
    • Method Detail

      • clearTimestamps

        public static ReplaceStringTransformer clearTimestamps()
        Predefined transformer replacing all timestamps with the epoch (1970-01-01T00:00:00Z).
        Returns:
        ReplaceStringTransformer
      • clearUUIDs

        public static ReplaceStringTransformer clearUUIDs()
        Predefined transformer placing all UUIDs with a blank one (00000000-0000-0000-0000-000000000000).
        Returns:
        ReplaceStringTransformer