/** * Generate all the values named in the bindings for a number of iterations, calling * a user-provided field setter for each name and object generated, with the * iteration number appended to the fieldName. * * @param fieldSetter user-provided object that implements {@link FieldSetter} * @param input the base input value for which the objects should be generated * @param count the number of iterations to generate values and names for */ public void setAllFieldsIterated(FieldSetter fieldSetter, long input, int count) { for (int i = 0; i < count; i++) { Object[] all = getAll(input+i); for (int j = 0; j < all.length; j++) { fieldSetter.setField(template.getBindPointNames().get(i) + i, all[i]); } } }
/** * Generate all the values named in the bindings for a number of iterations, calling * a user-provided field setter for each name and object generated, with the * iteration number appended to the fieldName, but only for the named bindings. * * @param fieldSetter user-provided object that implements {@link FieldSetter} * @param input the base input value for which the objects should be generated * @param count the number of iterations to generate values and names for * @param fieldName the field names for which to generate values and names */ public void setNamedFieldsIterated(FieldSetter fieldSetter, long input, int count, String... fieldName) { for (int i = 0; i < count; i++) { for (String s : fieldName) { fieldSetter.setField(s + i, get(s, input + i)); } } }
/** * Generate all the values named in the bind point names, then call the user-provided * field setter for each name and object generated. * * @param fieldSetter user-provided object that implements {@link FieldSetter} * @param input the input for which to generate values */ public void setAllFields(FieldSetter fieldSetter, long input) { Object[] all = getAll(input); for (int i = 0; i < all.length; i++) { fieldSetter.setField(template.getBindPointNames().get(i), all[i]); } }
/** * Generate only the values named in fieldNames, and then call the user-provided * field setter for each name and object generated. * * @param fieldSetter user-provided object that implements {@link FieldSetter}. * @param input the input for which to generate values * @param fieldName A varargs list of field names, or a String[] of names to set */ public void setNamedFields(FieldSetter fieldSetter, long input, String... fieldName) { for (String s : fieldName) { fieldSetter.setField(s, get(s, input)); } }