Class ReplaceStringTransformer

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

    public class ReplaceStringTransformer
    extends 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 Detail

      • ReplaceStringTransformer

        public ReplaceStringTransformer​(String pattern,
                                        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