Package com.google.common.truth
Class StandardSubjectBuilder
- java.lang.Object
- 
- com.google.common.truth.StandardSubjectBuilder
 
- 
- Direct Known Subclasses:
- Expect
 
 public class StandardSubjectBuilder extends Object In a fluent assertion chain, an object with which you can do any of the following:- Set an optional message with withMessage(java.lang.String).
- Specify the type of Subjectto create withabout(Subject.Factory).
- For the types of Subjectbuilt into Truth, directly specify the value under test withthat(Object).
 For more information about the methods in this class, see this FAQ entry. For people extending TruthYou won't extend this type. When you write a custom subject, see our doc on extensions. 
- 
- 
Method Summary
 
- 
- 
- 
Method Detail- 
forCustomFailureStrategypublic static StandardSubjectBuilder forCustomFailureStrategy(FailureStrategy strategy) Returns a new instance that invokes the givenFailureStrategywhen a check fails. Most users should not need this. If you think you do, see the documentation onFailureStrategy.
 - 
thatpublic final <ComparableT extends Comparable<?>> ComparableSubject<ComparableT> that(@Nullable ComparableT actual) 
 - 
thatpublic final BigDecimalSubject that(@Nullable BigDecimal actual) 
 - 
that@GwtIncompatible("ClassSubject.java") public final ClassSubject that(@Nullable Class<?> actual) 
 - 
thatpublic final ThrowableSubject that(@Nullable Throwable actual) 
 - 
thatpublic final LongSubject that(@Nullable Long actual) 
 - 
thatpublic final DoubleSubject that(@Nullable Double actual) 
 - 
thatpublic final FloatSubject that(@Nullable Float actual) 
 - 
thatpublic final IntegerSubject that(@Nullable Integer actual) 
 - 
thatpublic final BooleanSubject that(@Nullable Boolean actual) 
 - 
thatpublic final StringSubject that(@Nullable String actual) 
 - 
thatpublic final IterableSubject that(@Nullable Iterable<?> actual) 
 - 
thatpublic final <T extends @Nullable Object> ObjectArraySubject<T> that(T @Nullable [] actual) 
 - 
thatpublic final PrimitiveBooleanArraySubject that(boolean @Nullable [] actual) 
 - 
thatpublic final PrimitiveShortArraySubject that(short @Nullable [] actual) 
 - 
thatpublic final PrimitiveIntArraySubject that(int @Nullable [] actual) 
 - 
thatpublic final PrimitiveLongArraySubject that(long @Nullable [] actual) 
 - 
thatpublic final PrimitiveCharArraySubject that(char @Nullable [] actual) 
 - 
thatpublic final PrimitiveByteArraySubject that(byte @Nullable [] actual) 
 - 
thatpublic final PrimitiveFloatArraySubject that(float @Nullable [] actual) 
 - 
thatpublic final PrimitiveDoubleArraySubject that(double @Nullable [] actual) 
 - 
thatpublic final GuavaOptionalSubject that(@Nullable Optional<?> actual) 
 - 
thatpublic final MapSubject that(@Nullable Map<?,?> actual) 
 - 
thatpublic final MultimapSubject that(@Nullable Multimap<?,?> actual) 
 - 
thatpublic final MultisetSubject that(@Nullable Multiset<?> actual) 
 - 
thatpublic final TableSubject that(@Nullable Table<?,?,?> actual) 
 - 
thatpublic final OptionalSubject that(@Nullable Optional<?> actual) - Since:
- 1.3.0 (with access to OptionalSubjectpreviously part oftruth-java8-extension)
 
 - 
thatpublic final OptionalIntSubject that(@Nullable OptionalInt actual) - Since:
- 1.4.0 (with access to OptionalIntSubjectpreviously part oftruth-java8-extension)
 
 - 
thatpublic final OptionalLongSubject that(@Nullable OptionalLong actual) - Since:
- 1.4.0 (with access to OptionalLongSubjectpreviously part oftruth-java8-extension)
 
 - 
thatpublic final OptionalDoubleSubject that(@Nullable OptionalDouble actual) - Since:
- 1.4.0 (with access to OptionalDoubleSubjectpreviously part oftruth-java8-extension)
 
 - 
thatpublic final StreamSubject that(@Nullable Stream<?> actual) - Since:
- 1.3.0 (with access to StreamSubjectpreviously part oftruth-java8-extension)
 
 - 
thatpublic final IntStreamSubject that(@Nullable IntStream actual) - Since:
- 1.4.0 (with access to IntStreamSubjectpreviously part oftruth-java8-extension)
 
 - 
thatpublic final LongStreamSubject that(@Nullable LongStream actual) - Since:
- 1.4.0 (with access to LongStreamSubjectpreviously part oftruth-java8-extension)
 
 - 
that@GwtIncompatible @J2ObjCIncompatible public final PathSubject that(@Nullable Path actual) - Since:
- 1.4.0 (with access to PathSubjectpreviously part oftruth-java8-extension)
 
 - 
withMessagepublic final StandardSubjectBuilder withMessage(@Nullable String message) Returns a new instance that will output the given message before the main failure message. If this method is called multiple times, the messages will appear in the order that they were specified.
 - 
withMessagepublic final StandardSubjectBuilder withMessage(String format, @Nullable Object... args) Returns a new instance that will output the given message before the main failure message. If this method is called multiple times, the messages will appear in the order that they were specified.Note: the arguments will be substituted into the format template using Strings.lenientFormat. Note this only supports the%sspecifier.- Throws:
- IllegalArgumentException- if the number of placeholders in the format string does not equal the number of given arguments
 
 - 
aboutpublic final <S extends Subject,A> SimpleSubjectBuilder<S,A> about(Subject.Factory<S,A> factory) Given a factory for someSubjectclass, returns a builder whosethat(actual)method creates instances of that class. Created subjects use the previously set failure strategy and any previously set failure message.
 - 
aboutpublic final <CustomSubjectBuilderT extends CustomSubjectBuilder> CustomSubjectBuilderT about(CustomSubjectBuilder.Factory<CustomSubjectBuilderT> factory) A generic, advanced method of extension of Truth to new types, which is documented onCustomSubjectBuilder. Extension creators should preferSubject.Factoryif possible.
 - 
failpublic final void fail() Reports a failure.To set a message, first call withMessage(java.lang.String)(or, more commonly, use the shortcutTruth.assertWithMessage(java.lang.String)).
 
- 
 
-