/** * Creates a new field update, with encapsulated value updates, * specifying an addition of all values in a given list to an array. If this method is used on a weighted set data * type, the default weights will be 1. * * @param field the Field to add an array of values to * @param values a List containing the values to add * @return a FieldUpdate specifying the addition * @throws IllegalArgumentException if the runtime type of values does not match the type required by field * @throws UnsupportedOperationException if the field type is not array or weighted set * @see com.yahoo.document.update.ValueUpdate#createAddAll(java.util.List) * @see ValueUpdate#createAdd(FieldValue) */ public static FieldUpdate createAddAll(Field field, List<? extends FieldValue> values) { return new FieldUpdate(field, ValueUpdate.createAddAll(values)); }
/** * Creates a new field update, with encapsulated value updates, * specifying an addition of all key/weight pairs in a weighted set to a weighted set. If this method * is used on an array data type, the weights will be omitted. * * @param field the Field to add the key/weight pairs in a weighted set to * @param set a WeightedSet containing the key/weight pairs to add * @return a FieldUpdate specifying the addition * @throws IllegalArgumentException if the runtime type of values does not match the type required by field * @throws UnsupportedOperationException if the field type is not weighted set or array * @see ValueUpdate#createAdd(FieldValue, Integer) * @see com.yahoo.document.update.ValueUpdate#createAddAll(com.yahoo.document.datatypes.WeightedSet) */ public static FieldUpdate createAddAll(Field field, WeightedSet<? extends FieldValue> set) { return new FieldUpdate(field, ValueUpdate.createAddAll(set)); }