Package ru.objectsfill.core
Record Class RandomValueFieldSetterCallback
java.lang.Object
java.lang.Record
ru.objectsfill.core.RandomValueFieldSetterCallback
- All Implemented Interfaces:
FieldCallback
Callback that populates each field of an object with a randomly generated value during reflection traversal.
Handles field exclusion, extended per-field parameters, and primitive array special-casing.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of aRandomValueFieldSetterCallbackrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidProcesses a single field: skips final and excluded fields, applies extended parameters if present, and delegates to the appropriate generation method.final booleanIndicates whether some other object is "equal to" this one.fill()Returns the value of thefillrecord component.getExtendPredicate(Field field) Returns a predicate that matches anExtendparameter to a field either by field name or by assignable class type.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
RandomValueFieldSetterCallback
Creates an instance of aRandomValueFieldSetterCallbackrecord class.- Parameters:
fill- the value for thefillrecord component
-
-
Method Details
-
doWith
Processes a single field: skips final and excluded fields, applies extended parameters if present, and delegates to the appropriate generation method.- Specified by:
doWithin interfaceFieldCallback- Parameters:
field- the field to populate- Throws:
IllegalAccessException- if the field cannot be accessed via reflection
-
getExtendPredicate
Returns a predicate that matches anExtendparameter to a field either by field name or by assignable class type.- Parameters:
field- the field to match against- Returns:
- a predicate for filtering
Extendparameters
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
fill
Returns the value of thefillrecord component.- Returns:
- the value of the
fillrecord component
-