Class AbstractArraySubject<S extends AbstractArraySubject<S,T> , T>
java.lang.Object
com.google.common.truth.Subject<AbstractArraySubject<S,T>, T>
com.google.common.truth.AbstractArraySubject<S,T>
- Direct Known Subclasses:
ObjectArraySubject, PrimitiveBooleanArraySubject, PrimitiveByteArraySubject, PrimitiveCharArraySubject, PrimitiveDoubleArraySubject, PrimitiveFloatArraySubject, PrimitiveIntArraySubject, PrimitiveLongArraySubject
public abstract class AbstractArraySubject<S extends AbstractArraySubject<S,T>, T>
extends Subject<AbstractArraySubject<S,T>, T>
A common supertype for Array subjects, abstracting some common display and error infrastructure.
-
Nested Class Summary
Nested classes/interfaces inherited from class Subject
Subject.HasField -
Field Summary
Fields inherited from class Subject
failureStrategy -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidfailWithBadType(Object expected) protected StringvoidhasLength(int length) Fails if the array does not have the given length.voidisEmpty()Fails if the array is not empty (i.e.voidFails if the array is empty (i.e.(package private) abstract List<?> Renames the subject so that this name appears in the error messages in place of string representations of the subject.(package private) abstract StringMethods inherited from class Subject
check, equals, fail, fail, fail, failWithBadResults, failWithCustomSubject, failWithoutSubject, failWithRawMessage, getSubject, hasField, hashCode, internalCustomName, is, isA, isEqualTo, isInstanceOf, isNotA, isNotEqualTo, isNotInstanceOf, isNotNull, isNotSameAs, isNull, isSameAs, labeled
-
Constructor Details
-
AbstractArraySubject
AbstractArraySubject(FailureStrategy failureStrategy, T subject)
-
-
Method Details
-
isEmpty
public void isEmpty()Fails if the array is not empty (i.e.array.length != 0). -
isNotEmpty
public void isNotEmpty()Fails if the array is empty (i.e.array.length == 0). -
hasLength
public void hasLength(int length) Fails if the array does not have the given length. -
named
-
underlyingType
-
listRepresentation
-
getDisplaySubject
- Overrides:
getDisplaySubjectin classSubject<AbstractArraySubject<S extends AbstractArraySubject<S,T>, T>, T>
-
failWithBadType
-