@Override
    public FieldValue applyTo(FieldValue val) {
        if (val instanceof WeightedSet) {
            WeightedSet wset = (WeightedSet) val;
            wset.put(value, weight);
        } else if (val instanceof CollectionFieldValue) {
            CollectionFieldValue fval = (CollectionFieldValue) val;
            fval.add(value);
        } else {
            throw new IllegalStateException("Cannot add "+value+" to field of type " + val.getClass().getName());
        }
        return val;
    }
Return the associated weight of this value update.

@return the weight of this value update, or 1 if unset
document/src/main/java/com/yahoo/document/update/AddValueUpdate.java