Package com.google.common.truth
Class AbstractVerb<T extends AbstractVerb<T>>
- java.lang.Object
-
- com.google.common.truth.AbstractVerb<T>
-
- Direct Known Subclasses:
TestVerb
public abstract class AbstractVerb<T extends AbstractVerb<T>> extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractVerb.DelegatedVerb<S extends Subject<S,T>,T>
A special Verb implementation which wraps a SubjectFactoryprotected static class
AbstractVerb.MessagePrependingFailureStrategy
-
Field Summary
Fields Modifier and Type Field Description private FailureStrategy
failureStrategy
-
Constructor Summary
Constructors Constructor Description AbstractVerb(FailureStrategy failureStrategy)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description <S extends Subject<S,T>,T,SF extends SubjectFactory<S,T>>
AbstractVerb.DelegatedVerb<S,T>about(SF factory)
The recommended method of extension of Truth to new types, which is documented incom.google.common.truth.delegation.DelegationTest
.void
fail()
Triggers the failure strategy with an empty failure messagevoid
fail(java.lang.String format, java.lang.Object... args)
Triggers the failure strategy with the given failure messageprotected abstract java.lang.String
getFailureMessage()
protected FailureStrategy
getFailureStrategy()
<T> IteratingVerb<T>
in(java.lang.Iterable<T> data)
abstract T
withFailureMessage(java.lang.String failureMessage)
Overrides the failure message of the subsequent subject's propositions.
-
-
-
Field Detail
-
failureStrategy
private final FailureStrategy failureStrategy
-
-
Constructor Detail
-
AbstractVerb
public AbstractVerb(FailureStrategy failureStrategy)
-
-
Method Detail
-
getFailureStrategy
protected FailureStrategy getFailureStrategy()
-
fail
public void fail()
Triggers the failure strategy with an empty failure message
-
fail
public void fail(java.lang.String format, java.lang.Object... args)
Triggers the failure strategy with the given failure message
-
withFailureMessage
@CheckReturnValue public abstract T withFailureMessage(java.lang.String failureMessage)
Overrides the failure message of the subsequent subject's propositions.- Parameters:
factory
- a SubjectFactoryimplementation- See Also:
com.google.common.truth.delegation.DelegationTest
-
getFailureMessage
protected abstract java.lang.String getFailureMessage()
-
about
public <S extends Subject<S,T>,T,SF extends SubjectFactory<S,T>> AbstractVerb.DelegatedVerb<S,T> about(SF factory)
The recommended method of extension of Truth to new types, which is documented incom.google.common.truth.delegation.DelegationTest
.- Parameters:
factory
- a SubjectFactoryimplementation- See Also:
com.google.common.truth.delegation.DelegationTest
-
in
@GwtIncompatible("com.google.common.truth.IteratingVerb") public <T> IteratingVerb<T> in(java.lang.Iterable<T> data)
-
-