Class StringSubject


public class StringSubject extends ComparableSubject<StringSubject,String>
Propositions for string subjects.
  • Field Details

  • Constructor Details

  • Method Details

    • getDisplaySubject

      protected String getDisplaySubject()
      Overrides:
      getDisplaySubject in class Subject<StringSubject,String>
    • is

      public void is(Object expected)
      Overrides:
      is in class Subject<StringSubject,String>
    • isEqualTo

      public void isEqualTo(Object expected)
      Description copied from class: Subject
      Fails if the subject is not equal to the given object.
      Overrides:
      isEqualTo in class Subject<StringSubject,String>
    • isNull

      public void isNull()
      Fails if the string is not null.
      Overrides:
      isNull in class Subject<StringSubject,String>
    • hasLength

      public void hasLength(int expectedLength)
      Fails if the string does not have the given length.
    • isEmpty

      public void isEmpty()
      Fails if the string is not equal to the zero-length "empty string."
    • isNotEmpty

      public void isNotEmpty()
      Fails if the string is equal to the zero-length "empty string."
    • contains

      public void contains(CharSequence string)
      Fails if the string does not contain the given sequence.
    • doesNotContain

      public void doesNotContain(CharSequence string)
      Fails if the string contains the given sequence.
    • startsWith

      public void startsWith(String string)
      Fails if the string does not start with the given string.
    • endsWith

      public void endsWith(String string)
      Fails if the string does not end with the given string.
    • matches

      @GwtIncompatible("java.util.regex.Pattern") public void matches(String regex)
      Fails if the string does not match the given regex.
    • matches

      @GwtIncompatible("java.util.regex.Pattern") public void matches(Pattern regex)
      Fails if the string does not match the given regex.
    • doesNotMatch

      @GwtIncompatible("java.util.regex.Pattern") public void doesNotMatch(String regex)
      Fails if the string matches the given regex.
    • doesNotMatch

      @GwtIncompatible("java.util.regex.Pattern") public void doesNotMatch(Pattern regex)
      Fails if the string matches the given regex.
    • containsMatch

      @GwtIncompatible("java.util.regex.Pattern") public void containsMatch(Pattern pattern)
      Fails if the string does not contain a match on the given regex.
    • containsMatch

      @GwtIncompatible("java.util.regex.Pattern") public void containsMatch(String regex)
      Fails if the string does not contain a match on the given regex.
    • doesNotContainMatch

      @GwtIncompatible("java.util.regex.Pattern") public void doesNotContainMatch(Pattern pattern)
      Fails if the string contains a match on the given regex.
    • doesNotContainMatch

      @GwtIncompatible("java.util.regex.Pattern") public void doesNotContainMatch(String regex)
      Fails if the string contains a match on the given regex.
    • quote

      private static String quote(CharSequence toBeWrapped)