Class AbstractArraySubject

java.lang.Object
com.google.common.truth.Subject
com.google.common.truth.AbstractArraySubject
Direct Known Subclasses:
ObjectArraySubject, PrimitiveBooleanArraySubject, PrimitiveByteArraySubject, PrimitiveCharArraySubject, PrimitiveDoubleArraySubject, PrimitiveFloatArraySubject, PrimitiveIntArraySubject, PrimitiveLongArraySubject, PrimitiveShortArraySubject

abstract class AbstractArraySubject extends Subject
A common supertype for Array subjects, abstracting some common display and error infrastructure.
  • Field Details

    • actual

      private final Object actual
  • Constructor Details

  • Method Details

    • isEmpty

      public final void isEmpty()
      Fails if the array is not empty (i.e. array.length > 0).
    • isNotEmpty

      public final void isNotEmpty()
      Fails if the array is empty (i.e. array.length == 0).
    • hasLength

      public final void hasLength(int length)
      Fails if the array does not have the given length.
      Throws:
      IllegalArgumentException - if length < 0
    • length

      private int length()