Java Code Examples for org.apache.commons.collections.map.ListOrderedMap#putAll()

The following examples show how to use org.apache.commons.collections.map.ListOrderedMap#putAll() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CreationParameters.java    From gemfirexd-oss with Apache License 2.0 6 votes vote down vote up
/**
 * Returns the parameters for the given table.
 * 
 * @param table The table
 * @return The parameters
 */
public Map getParametersFor(Table table)
{
    ListOrderedMap result       = new ListOrderedMap();
    Map            globalParams = (Map)_parametersPerTable.get(null);
    Map            tableParams  = (Map)_parametersPerTable.get(table.getQualifiedName());

    if (globalParams != null)
    {
        result.putAll(globalParams);
    }
    if (tableParams != null)
    {
        result.putAll(tableParams);
    }
    return result;
}
 
Example 2
Source File: CreationParameters.java    From gemfirexd-oss with Apache License 2.0 6 votes vote down vote up
/**
 * Returns the parameters for the given table.
 * 
 * @param table The table
 * @return The parameters
 */
public Map getParametersFor(Table table)
{
    ListOrderedMap result       = new ListOrderedMap();
    Map            globalParams = (Map)_parametersPerTable.get(null);
    Map            tableParams  = (Map)_parametersPerTable.get(table.getQualifiedName());

    if (globalParams != null)
    {
        result.putAll(globalParams);
    }
    if (tableParams != null)
    {
        result.putAll(tableParams);
    }
    return result;
}
 
Example 3
Source File: AbstractMessageConverter.java    From elucidate-server with MIT License 5 votes vote down vote up
@SuppressWarnings("unchecked")
protected Map<String, Object> reorderJsonAttributes(Map<String, Object> jsonMap) {

    ListOrderedMap orderedJsonMap = new ListOrderedMap();
    orderedJsonMap.putAll(jsonMap);

    Object context = orderedJsonMap.get(JSONLDConstants.ATTRIBUTE_CONTEXT);
    if (context != null) {
        orderedJsonMap.remove(JSONLDConstants.ATTRIBUTE_CONTEXT);
        orderedJsonMap.put(0, JSONLDConstants.ATTRIBUTE_CONTEXT, context);
    }

    return orderedJsonMap;
}
 
Example 4
Source File: TableDisplayUtils.java    From beakerx with Apache License 2.0 5 votes vote down vote up
static List<Map<String, Object>> transformToIndex(Collection<Map<String, Object>> v, int columnIndex) {
  List<Map<String, Object>> result = new ArrayList<>();
  for (Map<String, Object> item : v) {
    ListOrderedMap listOrderedMap = new ListOrderedMap();
    listOrderedMap.putAll(item);
    Object key = listOrderedMap.get(columnIndex);
    Object value = listOrderedMap.getValue(columnIndex);
    listOrderedMap.remove(columnIndex);
    listOrderedMap.put(0, key, value);
    result.add(listOrderedMap);
  }
  return result;
}