Class HasLength

  • All Implemented Interfaces:
    Quality<java.lang.CharSequence>

    public final class HasLength
    extends QualityComposition<java.lang.CharSequence>
    • Constructor Summary

      Constructors 
      Constructor Description
      HasLength​(int size)
      Creates a Quality that matches if length of the CharSequence under test is equal to the given value.
      HasLength​(Quality<? super java.lang.Integer> delegate)
      Creates a Quality that matches if the length CharSequence under test matches the given Quality.
    • Method Summary

      • Methods inherited from class java.lang.Object

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

      • HasLength

        public HasLength​(int size)
        Creates a Quality that matches if length of the CharSequence under test is equal to the given value.
             assertThat("123", hasLength(3));
         
      • HasLength

        public HasLength​(Quality<? super java.lang.Integer> delegate)
        Creates a Quality that matches if the length CharSequence under test matches the given Quality.
             assertThat("123", hasLength(lessThan(4)));