コード例 #1
0
  @Test
  public void whenCreateImmutableMap_thenCreated() {
    final Map<String, Integer> salary =
        ImmutableMap.<String, Integer>builder()
            .put("John", 1000)
            .put("Jane", 1500)
            .put("Adam", 2000)
            .put("Tom", 2000)
            .build();

    assertEquals(1000, salary.get("John").intValue());
    assertEquals(2000, salary.get("Tom").intValue());
  }
コード例 #2
0
 private MapMessage createPayload(
     String key1, Object value1, String key2, Object value2, String key3, Object value3)
     throws JMSException {
   return newMapMessage(ImmutableMap.<String, Object>of(key1, value1, key2, value2, key3, value3));
 }
コード例 #3
0
 private MapMessage createPayload(String key, Object value) throws JMSException {
   return newMapMessage(ImmutableMap.<String, Object>of(key, value));
 }