Module nl.jqno.equalsverifier
Class MockitoValueProvider
java.lang.Object
nl.jqno.equalsverifier.internal.valueproviders.MockitoValueProvider
- All Implemented Interfaces:
ValueProvider
Provider of mock prefabricated instances of classes.
If Mockito is available on the classpath (or modulepath) of the project, will attempt to use that to construct
instances of the given type.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface nl.jqno.equalsverifier.internal.valueproviders.ValueProvider
provideOrThrow
-
Field Details
-
disable
private final boolean disable
-
-
Constructor Details
-
MockitoValueProvider
public MockitoValueProvider(boolean disable) Constructor.- Parameters:
disable- If true, this ValueProvider always returnsOptional.empty().
-
-
Method Details
-
provide
Returns a tuple of two different prefabricated values of the specified type.- Specified by:
providein interfaceValueProvider- Type Parameters:
T- The returned tuple will have this generic type.- Parameters:
tag- A description of the desired type, including generic parameters.attributes- The attributes of the field that the provided values must be linked to.- Returns:
- A tuple of two different values of the given type, or an empty Optional if none could be found.
-
buildMock
-