Module nl.jqno.equalsverifier
Interface ValueProvider
- All Known Implementing Classes:
AbstractValueProvider,ArrayValueProvider,BuiltinGenericPrefabValueProvider,BuiltinPrefabValueProvider,BuiltinVersionSpecificValueProvider,CachingValueProvider,ChainedValueProvider,EnumValueProvider,MockitoValueProvider,ObjectValueProvider,RecursionDetectingValueProvider,UserGenericPrefabValueProvider,UserPrefabValueProvider
public interface ValueProvider
Creator of prefabricated instances of classes.
These instances are intended to be used to populate a subject, i.e. the class that is currently being tested by EqualsVerifier.
Only creates values ones, and caches them once they've been created. Takes generics into account; i.e.,
List<Integer> is different from List<String>.
-
Method Summary
Modifier and TypeMethodDescriptionprovide(TypeTag tag, Attributes attributes) Returns a tuple of two different prefabricated values of the specified type.default <T> Tuple<T> provideOrThrow(TypeTag tag, Attributes attributes) Returns a tuple of prefabricated values of the specified type, or, if none exists, throws a NoValueException.
-
Method Details
-
provide
Returns a tuple of two different prefabricated values of the specified type.- 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.
-
provideOrThrow
Returns a tuple of prefabricated values of the specified type, or, if none exists, throws a NoValueException.- 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.
- Throws:
NoValueException- if no value could be found for the given tag.
-