Module nl.jqno.equalsverifier
Class UserPrefabValueProvider
java.lang.Object
nl.jqno.equalsverifier.internal.valueproviders.UserPrefabValueProvider
- All Implemented Interfaces:
ValueProvider
Provider of prefabricated instances of classes that have been provided by the user.
Note that this only works for non-generic classes, because this ValueProvider can't determine the generic types or
get values for them. For that, we either need withPrefabValuesForField, or the complicated recursion mechanism that
is currently provided by VintageValueProvider.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate <T> Tuple<T> copy()Copies the cache of this PrefabValueProvider into a new instance.provide(TypeTag tag, Attributes attributes) Returns a tuple of two different prefabricated values of the specified type.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
-
caches
-
-
Constructor Details
-
UserPrefabValueProvider
Constructor.- Parameters:
caches- The caches that this provider draws from.
-
-
Method Details
-
copy
Copies the cache of this PrefabValueProvider into a new instance.- Returns:
- A copy of this PrefabValueProvider.
-
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.
-
attempt
-