private static void merge(Map<String,Object> merged,Map<String,Object> attributes){
  for (  HashMap.Entry<String,Object> newEntry : attributes.entrySet()) {
    String key=newEntry.getKey();
    if (key.equals(ChronixQueryParams.SOLR_VERSION_FIELD)) {
      continue;
    }
    if (!merged.containsKey(key)) {
      merged.put(key,new LinkedHashSet());
    }
    LinkedHashSet values=(LinkedHashSet)merged.get(key);
    Object value=newEntry.getValue();
    if (value instanceof Collection && !values.contains(value)) {
      values.addAll((Collection)value);
    }
 else     if (!values.contains(value)) {
      values.add(value);
    }
  }
}

private static void merge ( Map < String , Object > merged , Map < String , Object > attributes ) { for ( HashMap . Entry < String , Object > newEntry : attributes . entrySet ( ) ) { String key = newEntry . getKey ( ) ; if ( key . equals ( ChronixQueryParams . SOLR_VERSION_FIELD ) ) { continue ; } if ( ! merged . containsKey ( key ) ) { merged . put ( key , new LinkedHashSet ( ) ) ; } LinkedHashSet values = ( LinkedHashSet ) merged . get ( key ) ; Object value = newEntry . getValue ( ) ; if ( value instanceof Collection && ! values . contains ( value ) ) { values . addAll ( ( Collection ) value ) ; } else if ( ! values . contains ( value ) ) { values . add ( value ) ; } } }
merges to sets of time series attributes . the result is set for each key holding the values . if the other value is a collection , than all values of the collection are added instead of the collection object .
