/** * Creates a predicate that matches the given attribute against a regex. A full match is not required * @param attribute The exchange attribute to check against. * @param pattern The pattern to look for. */ public static Predicate regex(final ExchangeAttribute attribute, final String pattern) { return new RegularExpressionPredicate(pattern, attribute); }
/** * Creates a predicate that matches the given attribute against a regex. * @param requireFullMatch If a full match is required in order to return true. * @param attribute The attribute to check against. * @param pattern The pattern to look for. */ public static Predicate regex(final ExchangeAttribute attribute, final String pattern, boolean requireFullMatch) { return new RegularExpressionPredicate(pattern, attribute, requireFullMatch); }
@Override public Predicate build(final Map<String, Object> config) { ExchangeAttribute value = (ExchangeAttribute) config.get("value"); if(value == null) { value = ExchangeAttributes.relativePath(); } Boolean fullMatch = (Boolean) config.get("full-match"); Boolean caseSensitive = (Boolean) config.get("case-sensitive"); String pattern = (String) config.get("pattern"); return new RegularExpressionPredicate(pattern, value, fullMatch == null ? false : fullMatch, caseSensitive == null ? true : caseSensitive); } }
/** * Creates a predicate that matches the given attribute against a regex. * @param requireFullMatch If a full match is required in order to return true. * @param attribute The attribute to check against. * @param pattern The pattern to look for. */ public static Predicate regex(final String attribute, final String pattern, final ClassLoader classLoader, final boolean requireFullMatch) { return new RegularExpressionPredicate(pattern, ExchangeAttributes.parser(classLoader).parse(attribute), requireFullMatch); }
/** * Creates a predicate that matches the given attribute against a regex. A full match is not required * @param attribute The exchange attribute to check against. * @param pattern The pattern to look for. */ public static Predicate regex(final ExchangeAttribute attribute, final String pattern) { return new RegularExpressionPredicate(pattern, attribute); }
/** * Creates a predicate that matches the given attribute against a regex. A full match is not required * @param attribute The exchange attribute to check against. * @param pattern The pattern to look for. */ public static Predicate regex(final ExchangeAttribute attribute, final String pattern) { return new RegularExpressionPredicate(pattern, attribute); }
/** * Creates a predicate that matches the given attribute against a regex. * @param requireFullMatch If a full match is required in order to return true. * @param attribute The attribute to check against. * @param pattern The pattern to look for. */ public static Predicate regex(final ExchangeAttribute attribute, final String pattern, boolean requireFullMatch) { return new RegularExpressionPredicate(pattern, attribute, requireFullMatch); }
/** * Creates a predicate that matches the given attribute against a regex. * @param requireFullMatch If a full match is required in order to return true. * @param attribute The attribute to check against. * @param pattern The pattern to look for. */ public static Predicate regex(final ExchangeAttribute attribute, final String pattern, boolean requireFullMatch) { return new RegularExpressionPredicate(pattern, attribute, requireFullMatch); }
@Override public Predicate build(final Map<String, Object> config) { ExchangeAttribute value = (ExchangeAttribute) config.get("value"); if(value == null) { value = ExchangeAttributes.relativePath(); } Boolean fullMatch = (Boolean) config.get("full-match"); Boolean caseSensitive = (Boolean) config.get("case-sensitive"); String pattern = (String) config.get("pattern"); return new RegularExpressionPredicate(pattern, value, fullMatch == null ? false : fullMatch, caseSensitive == null ? true : caseSensitive); } }
@Override public Predicate build(final Map<String, Object> config) { ExchangeAttribute value = (ExchangeAttribute) config.get("value"); if(value == null) { value = ExchangeAttributes.relativePath(); } Boolean fullMatch = (Boolean) config.get("full-match"); Boolean caseSensitive = (Boolean) config.get("case-sensitive"); String pattern = (String) config.get("pattern"); return new RegularExpressionPredicate(pattern, value, fullMatch == null ? false : fullMatch, caseSensitive == null ? true : caseSensitive); } }
/** * Creates a predicate that matches the given attribute against a regex. * @param requireFullMatch If a full match is required in order to return true. * @param attribute The attribute to check against. * @param pattern The pattern to look for. */ public static Predicate regex(final String attribute, final String pattern, final ClassLoader classLoader, final boolean requireFullMatch) { return new RegularExpressionPredicate(pattern, ExchangeAttributes.parser(classLoader).parse(attribute), requireFullMatch); }
/** * Creates a predicate that matches the given attribute against a regex. * @param requireFullMatch If a full match is required in order to return true. * @param attribute The attribute to check against. * @param pattern The pattern to look for. */ public static Predicate regex(final String attribute, final String pattern, final ClassLoader classLoader, final boolean requireFullMatch) { return new RegularExpressionPredicate(pattern, ExchangeAttributes.parser(classLoader).parse(attribute), requireFullMatch); }