/** when passed as a value to a ListConfigKey, causes each of these items to be added. * if you have just one, no need to wrap in a mod. */ // to prevent confusion (e.g. if a list is passed) we require two objects here. public static final <T> ListModification<T> add(final T o1, final T o2, final T ...oo) { List<T> l = new ArrayList<T>(); l.add(o1); l.add(o2); for (T o: oo) l.add(o); return new ListModificationBase<T>(l, false); } /** when passed as a value to a ListConfigKey, causes each of these items to be added */
/** when passed as a value to a ListConfigKey, causes the items to be added as a single element in the list */ public static final <T> ListModification<T> addItem(final T item) { return new ListModificationBase<T>(Collections.singletonList(item), false); } /** when passed as a value to a ListConfigKey, causes the list to be cleared and these items added */
/** when passed as a value to a ListConfigKey, causes the list to be cleared and these items added */ public static final <T> ListModification<T> set(final Collection<T> items) { return new ListModificationBase<T>(items, true); } }
/** when passed as a value to a ListConfigKey, causes each of these items to be added */ public static final <T> ListModification<T> addAll(final Collection<T> items) { return new ListModificationBase<T>(items, false); } /** when passed as a value to a ListConfigKey, causes the items to be added as a single element in the list */