Package dev.orne.test.rnd.params
Class DefaultParametersExtractor<P>
java.lang.Object
dev.orne.test.rnd.params.DefaultParametersExtractor<P>
- Type Parameters:
P
- The target generation parameters type
- All Implemented Interfaces:
ParametersExtractor<P>
@API(status=EXPERIMENTAL,
since="0.1")
public class DefaultParametersExtractor<P>
extends Object
implements ParametersExtractor<P>
Default implementation for
ParametersExtrator
.- Since:
- 0.1
- Version:
- 1.0, 2022-11
- Author:
- (w) Iker Hernaez
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultParametersExtractor
(@NotNull Collection<ParametersSourceExtractor<? super P, ?>> extractors) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionboolean
protected <T extends P,
S>
voidextract
(T params, S source) Tries to populating the specified target parameters extracting the parameter values from the specified source.void
extractParameters
(P params, @NotNull Object... sources) Extract the generation parameters from the specified sources.void
extractParameters
(P params, @NotNull Collection<?> sources) Extract the generation parameters from the specified sources.@NotNull List<ParametersSourceExtractor<? super P,
?>> Returns the available parameters source extractors.int
hashCode()
toString()
-
Constructor Details
-
DefaultParametersExtractor
public DefaultParametersExtractor(@NotNull @NotNull Collection<ParametersSourceExtractor<? super P, ?>> extractors) Creates a new instance.- Parameters:
extractors
- The generation parameters source extractors, in priority order
-
-
Method Details
-
getExtractors
Returns the available parameters source extractors.The returned list
- Returns:
- The parameters source extractors, in inverse priority order
-
extractParameters
Extract the generation parameters from the specified sources.- Specified by:
extractParameters
in interfaceParametersExtractor<P>
- Parameters:
params
- The generation parameterssources
- The parameter sources to apply
-
extractParameters
Extract the generation parameters from the specified sources.- Specified by:
extractParameters
in interfaceParametersExtractor<P>
- Parameters:
params
- The generation parameterssources
- The parameter sources to apply
-
extract
Tries to populating the specified target parameters extracting the parameter values from the specified source.This implementation applied the suitable source extractors in reverse priority order to allow extractors with higher priority to overwrite parameters extracted by lower priority extractors.
- Type Parameters:
T
- The parameters typeS
- The generation parameters source type- Parameters:
params
- The target parameterssource
- The generation parameters source
-
hashCode
public int hashCode() -
equals
-
toString
-