creates a RepeatingView providing a suitable editor field for every attribute in the list.

@param values map used for saving the data @see org.openengsb.ui.common.wicket.model.MapModel
970584
public static RepeatingView createFieldList(String id, List<AttributeDefinition> attributes,
            Map<String, String> values) {
        RepeatingView fields = new RepeatingView(id);
        for (AttributeDefinition a : attributes) {
            WebMarkupContainer row = new WebMarkupContainer(a.getId());
            MapModel<String, String> model = new MapModel<String, String>(values, a.getId());
            row.add(createEditorField("row", model, a));
            fields.add(row);
        }
        return fields;
    }
1287213
public void addMultiValuedField(String fieldName, List<String> values) {

        if ((values != null) && (values.size() > 0)) {
            for (String value : values) {
                m_doc.addField(fieldName, value);
            }
        }
    }
576993
public static <V> FieldScopeLogicMap<V> defaultValue(V value) {
    return new FieldScopeLogicMap<>(ImmutableList.of(Entry.of(FieldScopeLogic.all(), value)));
  }
951349
public Map<String, String> values(Object context) {

		if (this.attributes.isEmpty()) {
			return Collections.emptyMap();
		}
		Map<String, String> map = new HashMap<String, String>();
		for (KAttribute attribute : this.attributes) {
			String value = attribute.value(context);
			if (value != null) {
				map.put(attribute.getName(), value);
			}
		}
		return map;
	}
1113496
@NonNull
    public static SharedPreferences.Editor putStringArray(@NonNull SharedPreferences.Editor editor,
            @NonNull String key, @Nullable String[] values) {
        return putStringArray(editor, key, values, DEFAULT_DELIMITER);
    }
1360860
private Map<Integer, Object> getFilter(List<PivotField> fields, List<Object> values) {
//		long start = System.currentTimeMillis();
		Map<Integer, Object> filter = new HashMap<Integer, Object>();
		for (int i = 0; i < values.size(); i++) {
			int fieldIndex = fields.get(i).getIndex();
			// System.out.println(fieldIndex);
			filter.put(fieldIndex, values.get(i));
		}
//		long stop = System.currentTimeMillis();
//		System.out.println("getFilter in " + (stop - start));
	
		return filter;
	}
270735
public static Value.Builder makeValue(Iterable<Value> values) {
    return Value.newBuilder().setArrayValue(ArrayValue.newBuilder().addAllValues(values));
  }
1292769
public static void cursorDoubleToCursorValues(Cursor cursor, String field, ContentValues values)
    {
        cursorDoubleToContentValues(cursor, field, values, field);
    }
1174506
public static void initAllRuntimeParameterValues(QueryParameter param,
                                                  List<IdName> values, Map<String, Object> parameterValues) throws QueryException {

        if (param.getSelection().equals(QueryParameter.SINGLE_SELECTION)) {
            parameterValues.put(param.getName(), values.get(0));
        } else {
            Object[] val = new Object[values.size()];
            for (int k = 0, size = values.size(); k < size; k++) {
                val[k] = values.get(k);
            }
            parameterValues.put(param.getName(), val);
        }
    }
820331
public static String getSolrAddDocument(Map<String, String> values) {
    StringBuilder builder = new StringBuilder();
    builder.append("<add><doc>");
    for (Map.Entry<String, String> pair : values.entrySet()) {
      XMLUtils.addSolrField(builder, pair);
    }
    builder.append("</doc></add>");
    return builder.toString();
  }
1075599
public void setValueForIn(Object value, String name, Map<String, Object> map) {
        if (isListName(name)) {
            String valueStr = null;
            if (value != null) {
                valueStr = value.toString();
            }
            setValuesForIn(valueStr, stripListIndicator(name), map);
        } else {
            if (name.endsWith("\\[]")) {
                name = name.replace("\\[]", "[]");
            }
            String cleanName = htmlCleaner.cleanupValue(name);
            Object cleanValue = getCleanValue(value);
            if (map.containsKey(cleanName)) {
                // overwrite current value
                map.put(cleanName, cleanValue);
            } else {
                int firstDot = cleanName.indexOf(".");
                if (firstDot > -1) {
                    String key = cleanName.substring(0, firstDot);
                    Object nested = getValueImpl(map, key, false);
                    if (nested == null) {
                        nested = new LinkedHashMap<String, Object>();
                        if (isListIndexExpr(key)) {
                            setIndexedListValue(map, key, nested);
                        } else {
                            map.put(key, nested);
                        }
                    }
                    if (nested instanceof Map) {
                        Map<String, Object> nestedMap = (Map<String, Object>) nested;
                        String lastPart = cleanName.substring(firstDot + 1);
                        setValueForIn(cleanValue, lastPart, nestedMap);
                    } else {
                        throw new SlimFixtureException(false, key + " is not a map, but " + nested.getClass());
                    }
                } else if (isListIndexExpr(name)) {
                    setIndexedListValue(map, cleanName, cleanValue);
                } else {
                    map.put(cleanName, cleanValue);
                }
            }
        }
    }
757499
public static HeaderTemplate append(HeaderTemplate headerTemplate, Iterable<String> values) {
    Set<String> headerValues = new LinkedHashSet<>(headerTemplate.getValues());
    headerValues.addAll(StreamSupport.stream(values.spliterator(), false)
        .filter(Util::isNotBlank)
        .collect(Collectors.toSet()));
    return create(headerTemplate.getName(), headerValues);
  }
992679
protected void extractValues(HashMap<String, String> values) {
        for (Iterator<SyntaxElement> i = elements.listIterator(); i.hasNext(); ) {
            i.next().extractValues(values);
        }
    }
333514
private void fillColumnValuesMap(List<Map<String, Object>> results, Map<String, List<String>> columnValuesMap) {
        for (Map<String, Object> row : results) {
            for (Entry<String, Object> column : row.entrySet()) {
                String columnValue;
                String columnName = column.getKey();
                if (!columnValuesMap.containsKey(columnName)) {
                    columnValuesMap.put(columnName, new ArrayList<String>());
                }

                if (column.getValue() instanceof byte[]) {
                    columnValue = Base64.encodeBase64String((byte[]) column.getValue());
                } else {
                    columnValue = column.getValue() == null ? null : column.getValue().toString();
                }

                columnValuesMap.get(columnName).add((columnValue));
            }
        }
    }

    /**
     * Gets the script validator implementation either autowired from application context
     * or if not set here a default implementation.
     */
    private SqlResultSetScriptValidator getScriptValidator() {
        if (validator != null) {
            return validator;
        } else {
            return new GroovySqlResultSetValidator();
        }
    }

    /**
     * Constructs a delimited string from multiple row values in result set in order to
     * set this expression as variable value.
     *
     * @param rowValues the list of values representing the allResultRows for a column in the result set.
     * @return the variable value as delimited string or single value.
     */
    private String constructVariableValue(List<String> rowValues) {
        if (CollectionUtils.isEmpty(rowValues)) {
            return "";
        } else if (rowValues.size() == 1) {
            return rowValues.get(0) == null ? NULL_VALUE : rowValues.get(0);
        } else {
            StringBuilder result = new StringBuilder();

            Iterator<String> it = rowValues.iterator();

            result.append(it.next());
            while (it.hasNext()) {
                String nextValue = it.next();
                result.append(";" + (nextValue == null ? NULL_VALUE : nextValue));
            }

            return result.toString();
        }
    }

    /**
     * Validates the database result set. At first script validation is done (if any was given).
     * Afterwards the control result set validation is performed.
     *
     * @param columnValuesMap map containing column names as keys and list of string as retrieved values from db
     * @param allResultRows list of all result rows retrieved from database
     * @return success flag
     * @throws UnknownElementException
     * @throws ValidationException
     */
    private void performValidation(final Map<String, List<String>> columnValuesMap,
            List<Map<String, Object>> allResultRows, TestContext context)
            throws UnknownElementException, ValidationException {
        // apply script validation if specified
        if (scriptValidationContext != null) {
            getScriptValidator().validateSqlResultSet(allResultRows, scriptValidationContext, context);
        }

        //now apply control set validation if specified
        if (CollectionUtils.isEmpty(controlResultSet)) {
            return;
        }
        performControlResultSetValidation(columnValuesMap, context);
        log.info("SQL query validation successful: All values OK");
    }

    private void performControlResultSetValidation(final Map<String, List<String>> columnValuesMap, TestContext context)
            throws CitrusRuntimeException {
        for (Entry<String, List<String>> controlEntry : controlResultSet.entrySet()) {
            String columnName = controlEntry.getKey();

            if (columnValuesMap.containsKey(columnName.toLowerCase())) {
                columnName = columnName.toLowerCase();
            } else if (columnValuesMap.containsKey(columnName.toUpperCase())) {
                columnName = columnName.toUpperCase();
            } else if (!columnValuesMap.containsKey(columnName)) {
                throw new CitrusRuntimeException("Could not find column '" + columnName + "' in SQL result set");
            }

            List<String> resultColumnValues = columnValuesMap.get(columnName);
            List<String> controlColumnValues = controlEntry.getValue();

            // first check size of column values (representing number of allResultRows in result set)
            if (resultColumnValues.size() != controlColumnValues.size()) {
                throw new CitrusRuntimeException("Validation failed for column: '" +  columnName + "' " +
                        "expected rows count: " + controlColumnValues.size() + " but was " + resultColumnValues.size());
            }

            Iterator<String> it = resultColumnValues.iterator();
            for (String controlValue : controlColumnValues) {
                String resultValue = it.next();
                //check if controlValue is variable or function (and resolve it)
                controlValue = context.replaceDynamicContentInString(controlValue);

                validateSingleValue(columnName, controlValue, resultValue, context);
            }
        }
    }

    /**
     * Does some simple validation on the SQL statement.
     * @param stmt The statement which is to be validated.
     */
    protected void validateSqlStatement(String stmt) {
        if (!stmt.toLowerCase().startsWith("select")) {
            throw new CitrusRuntimeException("Missing keyword SELECT in statement: " + stmt);
        }
    }

    protected void validateSingleValue(String columnName, String controlValue, String resultValue, TestContext context) {
        // check if value is ignored
        if (controlValue.equals(Citrus.IGNORE_PLACEHOLDER)) {
            if (log.isDebugEnabled()) {
                log.debug("Ignoring column value '" + columnName + "(resultValue)'");
            }
            return;
        }
        
        if (ValidationMatcherUtils.isValidationMatcherExpression(controlValue)) {
            ValidationMatcherUtils.resolveValidationMatcher(columnName, resultValue, controlValue, context);
            return;
        }
        
        if (resultValue == null) {
            if (isCitrusNullValue(controlValue)) {
                if (log.isDebugEnabled()) {
                    log.debug("Validating database value for column: ''" +
                            columnName + "'' value as expected: NULL - value OK");
                }
                return;
            } else {
                throw new ValidationException("Validation failed for column: '" +  columnName + "'"
                        + "found value: NULL expected value: " + controlValue);
            }
        }

        if (resultValue.equals(controlValue)) {
            if (log.isDebugEnabled()) {
                log.debug("Validation successful for column: '" + columnName +
                        "' expected value: " + controlValue + " - value OK");
            }
        } else {
            throw new ValidationException("Validation failed for column: '" +  columnName + "'"
                    + " found value: '"
                    + resultValue
                    + "' expected value: "
                    + ((controlValue.length()==0) ? NULL_VALUE : controlValue));
        }
    }
498989
@Override
  public void setValue(final List<T> value) {
    if (list == null && value == null) {
      // fast exit
      return;
    }
    if (list != null && list.isSameValue(value)) {
      // setting the same value as the one being edited
      list.refresh();
      return;
    }

    if (list != null) {
      // Having entire value reset, so dump the wrapper gracefully
      list.detach();
    }
    if (value == null) {
      list = null;
    } else {
      list = new ListValidationEditorWrapper<>(value, chain, editorSource, parentDriver);
      list.attach();
    }
  }
1184048
public String encode(String... values) {
    ImmutableMap.Builder<String, String> builder = ImmutableMap.builder();
    int i = 0;
    for (String value : values) {
      builder.put("$" + i++, value);
    }
    // We will get an error if there are named bindings which are not reached by values.
    return instantiate(builder.build());
  }
987173
public void setValues(java.util.Collection<Value> values) {
        if (values == null) {
            this.values = null;
            return;
        }

        this.values = new java.util.ArrayList<Value>(values);
    }