java.lang.Object
nl.jqno.equalsverifier.internal.reflection.FieldMutator

public class FieldMutator extends Object
Allows for a field in an object reference to be set to another value.
  • Field Details

  • Constructor Details

    • FieldMutator

      public FieldMutator(FieldProbe probe)
      Constructor.
      Parameters:
      probe - A field probe pointing to the field to mutate.
  • Method Details

    • setNewValue

      public void setNewValue(Object object, Object newValue)
      Assigns newValue to the current field in object.
      Parameters:
      object - The instance on which to re-assign the current field.
      newValue - The value to assign to the field.
    • safelySetField

      private void safelySetField(Object object, Object newValue) throws IllegalAccessException
      Throws:
      IllegalAccessException