/** * Add an action, replacing any existing actions of the (exact) same class. * Note: calls to {@link #getAllActions()} that happen before calls to this method may not see the update. * Note: this method does not affect transient actions contributed by a {@link TransientActionFactory}. * Note: this method cannot provide concurrency control due to the backing storage being a * {@link CopyOnWriteArrayList} so concurrent calls to any of the mutation methods may produce surprising results * though technically consistent from the concurrency contract of {@link CopyOnWriteArrayList} (we would need * some form of transactions or a different backing type). * * @param a an action to add/replace * @since 1.548 * @see #addOrReplaceAction(Action) if you want to know whether the backing {@link #actions} was modified, for * example in cases where the caller would need to persist the {@link Actionable} in order to persist the change * and there is a desire to elide unnecessary persistence of unmodified objects. */ @SuppressWarnings({"ConstantConditions", "deprecation"}) @SuppressFBWarnings("RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE") public void replaceAction(@Nonnull Action a) { addOrReplaceAction(a); }
/** * Add an action, replacing any existing actions of the (exact) same class. * Note: calls to {@link #getAllActions()} that happen before calls to this method may not see the update. * Note: this method does not affect transient actions contributed by a {@link TransientActionFactory}. * Note: this method cannot provide concurrency control due to the backing storage being a * {@link CopyOnWriteArrayList} so concurrent calls to any of the mutation methods may produce surprising results * though technically consistent from the concurrency contract of {@link CopyOnWriteArrayList} (we would need * some form of transactions or a different backing type). * * @param a an action to add/replace * @since 1.548 * @see #addOrReplaceAction(Action) if you want to know whether the backing {@link #actions} was modified, for * example in cases where the caller would need to persist the {@link Actionable} in order to persist the change * and there is a desire to elide unnecessary persistence of unmodified objects. */ @SuppressWarnings({"ConstantConditions", "deprecation"}) @SuppressFBWarnings("RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE") public void replaceAction(@Nonnull Action a) { addOrReplaceAction(a); }