Package fi.luomus.commons.containers

Examples of fi.luomus.commons.containers.KeyValuePair


    }
    return map;
  }
 
  public static KeyValuePair pair(String key, String value) {
    return new KeyValuePair(key, value);
  }
View Full Code Here


  }

  private void addAdditionParameters(String readerName, HTTPFeedReaderClient feedReaderClient) {
    for (String parameterAndValue : config.get(readerName+"_additionalParameters").split("&")) {
      String[] parts = parameterAndValue.split("=");
            feedReaderClient = feedReaderClient.withAdditionalParameter(new KeyValuePair(parts[0], parts[1]));
    }
  }
View Full Code Here

    Integer individualCountMax = rs.getInt(5);
    Date oldestRecord = getDate(rs.getString(6));
    Date newestRecord = getDate(rs.getString(7));
   
    AggregateResponseEntry entry = new AggregateResponseEntry(
        Utils.list(new KeyValuePair("lat", lat), new KeyValuePair("long", lon)),
        count, individualCountSum, individualCountMax, oldestRecord, newestRecord
    );
    return entry;
  }
View Full Code Here

    int i = 1;
    List<KeyValuePair> aggregatedFields = new ArrayList<KeyValuePair>();
    for (String fieldName : aggregateBy) {
      String value = rs.getString(i++);
      if (value == null) value = "";
      aggregatedFields.add(new KeyValuePair(fieldName, value));
    }
   
    Integer count = getInt(rs, i++);
    Integer individualCountSum = rs.getInt(i++);
    Integer individualCountMax = rs.getInt(i++);
View Full Code Here

    @Test
    public void testAdditionalParamsFeed() throws Exception {
        MockHTTPClient httpClient = new MockHTTPClient(FEED_WITH_ENTRIES_XML);
        HTTPFeedReaderClient client = new HTTPFeedReaderClient(httpClient);
        client = client.withAdditionalParameter(new KeyValuePair("foo", "bar"));
        client.getFeedEntriesFromSeq(getMockUri(), 1, 1);

        hasKeyValuePair(new KeyValuePair("foo", "bar"), httpClient.getLastRequest().getURI());
    }
View Full Code Here

    }
    @Test
    public void testAdditionalParamsSingle() throws Exception {
        MockHTTPClient httpClient = new MockHTTPClient(SINGLE_ENTRY);
        HTTPFeedReaderClient client = new HTTPFeedReaderClient(httpClient);
        client = client.withAdditionalParameter(new KeyValuePair("foo", "bar"));
        client.getFeedDocument(getMockUri());

        hasKeyValuePair(new KeyValuePair("foo", "bar"), httpClient.getLastRequest().getURI());
    }
View Full Code Here

TOP

Related Classes of fi.luomus.commons.containers.KeyValuePair

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.