Class Matchers.StringMatcher

  • Direct Known Subclasses:
    AutoValue_Matchers_StringMatcher
    Enclosing class:
    Matchers

    public abstract static class Matchers.StringMatcher
    extends java.lang.Object
    Represents various ways to match a string .
    • Constructor Summary

      Constructors 
      Constructor Description
      StringMatcher()  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) abstract java.lang.String contains()  
      private static Matchers.StringMatcher create​(java.lang.String exact, java.lang.String prefix, java.lang.String suffix, com.google.re2j.Pattern regEx, java.lang.String contains, boolean ignoreCase)  
      (package private) abstract java.lang.String exact()  
      static Matchers.StringMatcher forContains​(java.lang.String contains)
      The input string should contain this substring.
      static Matchers.StringMatcher forExact​(java.lang.String exact, boolean ignoreCase)
      The input string should exactly matches the specified string.
      static Matchers.StringMatcher forPrefix​(java.lang.String prefix, boolean ignoreCase)
      The input string should have the prefix.
      static Matchers.StringMatcher forSafeRegEx​(com.google.re2j.Pattern regEx)
      The input string should match this pattern.
      static Matchers.StringMatcher forSuffix​(java.lang.String suffix, boolean ignoreCase)
      The input string should have the suffix.
      (package private) abstract boolean ignoreCase()  
      boolean matches​(java.lang.String args)
      Returns the matching result for this string.
      (package private) abstract java.lang.String prefix()  
      (package private) abstract com.google.re2j.Pattern regEx()  
      (package private) abstract java.lang.String suffix()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StringMatcher

        public StringMatcher()
    • Method Detail

      • exact

        @Nullable
        abstract java.lang.String exact()
      • prefix

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

        @Nullable
        abstract java.lang.String suffix()
      • regEx

        @Nullable
        abstract com.google.re2j.Pattern regEx()
      • contains

        @Nullable
        abstract java.lang.String contains()
      • ignoreCase

        abstract boolean ignoreCase()
      • forExact

        public static Matchers.StringMatcher forExact​(java.lang.String exact,
                                                      boolean ignoreCase)
        The input string should exactly matches the specified string.
      • forPrefix

        public static Matchers.StringMatcher forPrefix​(java.lang.String prefix,
                                                       boolean ignoreCase)
        The input string should have the prefix.
      • forSuffix

        public static Matchers.StringMatcher forSuffix​(java.lang.String suffix,
                                                       boolean ignoreCase)
        The input string should have the suffix.
      • forSafeRegEx

        public static Matchers.StringMatcher forSafeRegEx​(com.google.re2j.Pattern regEx)
        The input string should match this pattern.
      • forContains

        public static Matchers.StringMatcher forContains​(java.lang.String contains)
        The input string should contain this substring.
      • matches

        public boolean matches​(java.lang.String args)
        Returns the matching result for this string.
      • create

        private static Matchers.StringMatcher create​(@Nullable
                                                     java.lang.String exact,
                                                     @Nullable
                                                     java.lang.String prefix,
                                                     @Nullable
                                                     java.lang.String suffix,
                                                     @Nullable
                                                     com.google.re2j.Pattern regEx,
                                                     @Nullable
                                                     java.lang.String contains,
                                                     boolean ignoreCase)