Package ru.objectsfill.object_param
Class Extend.FillFieldParametersBuilder
java.lang.Object
ru.objectsfill.object_param.Extend.FillFieldParametersBuilder
- Enclosing class:
- Extend
Fluent builder for constructing
Extend instances.-
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty builder.FillFieldParametersBuilder(Class<?> clazz) Creates a builder targeting fields by class type.FillFieldParametersBuilder(String fieldName) Creates a builder targeting a field by name.FillFieldParametersBuilder(UnaryOperator<Object> singleChangeFunction) Creates a builder with a global mutation function. -
Method Summary
Modifier and TypeMethodDescriptionaddMutationFunction(UnaryOperator<Object> singleChangeFunction) Sets the mutation function applied to the generated value before assignment.collectionSize(Integer collectionSize) Sets the collection size override for this field.gen()Builds and returns theExtendinstance.valueLength(Integer valueLength) Sets the value length override for this field.
-
Constructor Details
-
FillFieldParametersBuilder
Creates a builder targeting a field by name.- Parameters:
fieldName- the field name to match
-
FillFieldParametersBuilder
Creates a builder targeting fields by class type.- Parameters:
clazz- the class type to match
-
FillFieldParametersBuilder
Creates a builder with a global mutation function.- Parameters:
singleChangeFunction- the mutation function to apply
-
FillFieldParametersBuilder
public FillFieldParametersBuilder()Creates an empty builder.
-
-
Method Details
-
collectionSize
Sets the collection size override for this field.- Parameters:
collectionSize- the number of collection elements- Returns:
- this builder
-
valueLength
Sets the value length override for this field.- Parameters:
valueLength- the string value length- Returns:
- this builder
-
addMutationFunction
public Extend.FillFieldParametersBuilder addMutationFunction(UnaryOperator<Object> singleChangeFunction) Sets the mutation function applied to the generated value before assignment.- Parameters:
singleChangeFunction- the mutation function- Returns:
- this builder
-
gen
Builds and returns theExtendinstance.- Returns:
- the constructed Extend
-