void (boolean enabled) { Object instance = getInstance(); try { instance.getClass().getField(myFieldName).setBoolean(instance, enabled); } catch (Exception exception) { LOG.error(String.format("Boolean field '%s' not found in %s", myFieldName, instance), exception); } fireUpdated(); }