Class Matchers.HeaderMatcher

    • Constructor Detail

      • HeaderMatcher

        public HeaderMatcher()
    • Method Detail

      • name

        public abstract java.lang.String name()
      • exactValue

        @Nullable
        public abstract java.lang.String exactValue()
      • safeRegEx

        @Nullable
        public abstract com.google.re2j.Pattern safeRegEx()
      • present

        @Nullable
        public abstract java.lang.Boolean present()
      • prefix

        @Nullable
        public abstract java.lang.String prefix()
      • suffix

        @Nullable
        public abstract java.lang.String suffix()
      • contains

        @Nullable
        public abstract java.lang.String contains()
      • inverted

        public abstract boolean inverted()
      • forExactValue

        public static Matchers.HeaderMatcher forExactValue​(java.lang.String name,
                                                           java.lang.String exactValue,
                                                           boolean inverted)
        The request header value should exactly match the specified value.
      • forSafeRegEx

        public static Matchers.HeaderMatcher forSafeRegEx​(java.lang.String name,
                                                          com.google.re2j.Pattern safeRegEx,
                                                          boolean inverted)
        The request header value should match the regular expression pattern.
      • forPresent

        public static Matchers.HeaderMatcher forPresent​(java.lang.String name,
                                                        boolean present,
                                                        boolean inverted)
        The request header value should exist.
      • forPrefix

        public static Matchers.HeaderMatcher forPrefix​(java.lang.String name,
                                                       java.lang.String prefix,
                                                       boolean inverted)
        The request header value should have this prefix.
      • forSuffix

        public static Matchers.HeaderMatcher forSuffix​(java.lang.String name,
                                                       java.lang.String suffix,
                                                       boolean inverted)
        The request header value should have this suffix.
      • forContains

        public static Matchers.HeaderMatcher forContains​(java.lang.String name,
                                                         java.lang.String contains,
                                                         boolean inverted)
        The request header value should have this substring.
      • create

        private static Matchers.HeaderMatcher create​(java.lang.String name,
                                                     @Nullable
                                                     java.lang.String exactValue,
                                                     @Nullable
                                                     com.google.re2j.Pattern safeRegEx,
                                                     @Nullable
                                                     Matchers.HeaderMatcher.Range range,
                                                     @Nullable
                                                     java.lang.Boolean present,
                                                     @Nullable
                                                     java.lang.String prefix,
                                                     @Nullable
                                                     java.lang.String suffix,
                                                     @Nullable
                                                     java.lang.String contains,
                                                     @Nullable
                                                     Matchers.StringMatcher stringMatcher,
                                                     boolean inverted)
      • matches

        public boolean matches​(@Nullable
                               java.lang.String value)
        Returns the matching result.