Package com.google.common.truth
Class PrimitiveFloatArraySubject
- java.lang.Object
-
- com.google.common.truth.Subject<AbstractArraySubject<S,T>,T>
-
- com.google.common.truth.AbstractArraySubject<PrimitiveFloatArraySubject,float[]>
-
- com.google.common.truth.PrimitiveFloatArraySubject
-
public class PrimitiveFloatArraySubject extends AbstractArraySubject<PrimitiveFloatArraySubject,float[]>
A Subject to handle testing propositions forfloat[]. Note: this class deprecates some common methods because the operation of equality and comparison on floating point numbers requires additional specification. Alternatives equality tests are provided.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.common.truth.Subject
Subject.HasField
-
-
Field Summary
-
Fields inherited from class com.google.common.truth.Subject
failureStrategy
-
-
Constructor Summary
Constructors Constructor Description PrimitiveFloatArraySubject(FailureStrategy failureStrategy, float[] o)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private ListSubject<?,java.lang.Float,java.util.List<java.lang.Float>>asList()voidisEqualTo(java.lang.Object expected)Deprecated.use#isEqualTo(Object, double)voidisEqualTo(java.lang.Object expected, float tolerance)A proposition that the provided float[] 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)Deprecated.use#isNotEqualTo(Object, double)voidisNotEqualTo(java.lang.Object expectedArray, float tolerance)protected java.util.List<java.lang.Float>listRepresentation()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
-
PrimitiveFloatArraySubject
PrimitiveFloatArraySubject(FailureStrategy failureStrategy, float[] o)
-
-
Method Detail
-
underlyingType
protected java.lang.String underlyingType()
- Specified by:
underlyingTypein classAbstractArraySubject<PrimitiveFloatArraySubject,float[]>
-
listRepresentation
protected java.util.List<java.lang.Float> listRepresentation()
- Specified by:
listRepresentationin classAbstractArraySubject<PrimitiveFloatArraySubject,float[]>
-
isEqualTo
@Deprecated public void isEqualTo(java.lang.Object expected)
Deprecated.use#isEqualTo(Object, double)This form is unsafe for floating point types, and will throw anUnsupportedOperationException.- Overrides:
isEqualToin classSubject<AbstractArraySubject<PrimitiveFloatArraySubject,float[]>,float[]>
-
isEqualTo
public void isEqualTo(java.lang.Object expected, float tolerance)A proposition that the provided float[] 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.
-
isNotEqualTo
@Deprecated public void isNotEqualTo(java.lang.Object expected)
Deprecated.use#isNotEqualTo(Object, double)This form is unsafe for floating point types, and will throw anUnsupportedOperationException.- Overrides:
isNotEqualToin classSubject<AbstractArraySubject<PrimitiveFloatArraySubject,float[]>,float[]>
-
isNotEqualTo
public void isNotEqualTo(java.lang.Object expectedArray, float tolerance)
-
asList
private ListSubject<?,java.lang.Float,java.util.List<java.lang.Float>> asList()
-
-