Class ClassValueProvider
java.lang.Object
de.floydkretschmar.fixturize.stategies.constants.value.providers.fallback.ClassValueProvider
- All Implemented Interfaces:
ValueProvider
Defines the default fallback strategy for getting values where no value provider is defined:
1. If type is annotated with
FixtureConstructor or FixtureBuilder: use the annotation with the most
FixtureConstructor.constructorParameters() or FixtureBuilder.usedSetters() and use the creation method
defined by that annotation
2. If any lombok annotations are present, try to generate to correct value according to the annotation:
Builder: create an inline builder for all fieldsAllArgsConstructor: create an inline new call to the constructor using all fieldsRequiredArgsConstructor: create an inline new call to the constructor using all fields that are final and don't have a constant valueAllArgsConstructor: create an inline new call to the constructor without arguments
-
Field Summary
Fields inherited from interface de.floydkretschmar.fixturize.stategies.constants.value.providers.ValueProvider
DEFAULT_VALUE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprovideValueAsString(Element field, TypeMetadata metadata) Returns a string representation of a value that will be used when creating a constant for the specified field.
-
Constructor Details
-
ClassValueProvider
-
-
Method Details
-
provideValueAsString
Description copied from interface:ValueProviderReturns a string representation of a value that will be used when creating a constant for the specified field.- Specified by:
provideValueAsStringin interfaceValueProvider- Parameters:
field- - for which the value is being providedmetadata- - used for creating the fixture- Returns:
- the string representation of the value
-