Package com.google.common.truth
Class ObjectArraySubject<T>
- java.lang.Object
-
- com.google.common.truth.Subject<AbstractArraySubject<S,T>,T>
-
- com.google.common.truth.AbstractArraySubject<ObjectArraySubject<T>,T[]>
-
- com.google.common.truth.ObjectArraySubject<T>
-
public class ObjectArraySubject<T> extends AbstractArraySubject<ObjectArraySubject<T>,T[]>
A Subject to handle testing propositions forObject[]and more genericallyT[].
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.common.truth.Subject
Subject.HasField
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringtypeName-
Fields inherited from class com.google.common.truth.Subject
failureStrategy
-
-
Constructor Summary
Constructors Constructor Description ObjectArraySubject(FailureStrategy failureStrategy, T[] o)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ListSubject<?,T,java.util.List<T>>asList()voidisEqualTo(java.lang.Object expected)A proposition that the provided Object[] is an array of the same length and type, and contains elements such that each element inexpectedis equal to each element in the subject, and in the same position.voidisNotEqualTo(java.lang.Object expected)Fails if the subject is equal to the given object.protected java.util.List<T>listRepresentation()private java.lang.StringtypeNameFromInstance(java.lang.Object instance)protected java.lang.StringunderlyingType()-
Methods inherited from class com.google.common.truth.AbstractArraySubject
failWithBadType, getDisplaySubject, hasLength, isEmpty, isNotEmpty, named
-
Methods inherited from class com.google.common.truth.Subject
check, equals, fail, fail, fail, failWithBadResults, failWithCustomSubject, failWithoutSubject, failWithRawMessage, getSubject, hasField, hashCode, internalCustomName, is, isA, isInstanceOf, isNotA, isNotInstanceOf, isNotNull, isNotSameAs, isNull, isSameAs, labeled
-
-
-
-
Constructor Detail
-
ObjectArraySubject
ObjectArraySubject(FailureStrategy failureStrategy, T[] o)
-
-
Method Detail
-
underlyingType
protected java.lang.String underlyingType()
- Specified by:
underlyingTypein classAbstractArraySubject<ObjectArraySubject<T>,T[]>
-
listRepresentation
protected java.util.List<T> listRepresentation()
- Specified by:
listRepresentationin classAbstractArraySubject<ObjectArraySubject<T>,T[]>
-
typeNameFromInstance
private java.lang.String typeNameFromInstance(java.lang.Object instance)
-
isEqualTo
public void isEqualTo(java.lang.Object expected)
A proposition that the provided Object[] is an array of the same length and type, and contains elements such that each element inexpectedis equal to each element in the subject, and in the same position.- Overrides:
isEqualToin classSubject<AbstractArraySubject<ObjectArraySubject<T>,T[]>,T[]>
-
isNotEqualTo
public void isNotEqualTo(java.lang.Object expected)
Description copied from class:SubjectFails if the subject is equal to the given object.- Overrides:
isNotEqualToin classSubject<AbstractArraySubject<ObjectArraySubject<T>,T[]>,T[]>
-
asList
public ListSubject<?,T,java.util.List<T>> asList()
-
-