com.amazonaws.util
Class ImmutableMapParameter<K,V>

java.lang.Object
  extended by com.amazonaws.util.ImmutableMapParameter<K,V>
Type Parameters:
K - Class of the key for the map.
V - Class of the value for the map.
All Implemented Interfaces:
java.util.Map<K,V>

public class ImmutableMapParameter<K,V>
extends java.lang.Object
implements java.util.Map<K,V>

An immutable map that could be built by convenient constructors.

Example of using map Builder:

   
 Map<String, AttibuteValue> item =
       new ImmutableMapParameter.Builder<String, AttibuteValue>()
           .put("one", new AttibuteValue("1"))
           .put("two", new AttibuteValue("2"))
           .put("three", new AttibuteValue("3"))
           .build();
 
 
For small immutable maps (up to five entries), the ImmutableMapParamter.of() methods are preferred:
   
 Map<String, AttibuteValue> item =
       ImmutableMapParameter
           .of("one", new AttributeValue("1"), 
               "two", new AttributeValue("2"),
               "three", new AttributeValue("3"), 
 
 


Nested Class Summary
static class ImmutableMapParameter.Builder<K,V>
          A convenient builder for creating ImmutableMapParameter instances.
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Method Summary
static
<K,V> ImmutableMapParameter.Builder<K,V>
builder()
          Returns a new MapParameterBuilder instance.
 void clear()
          Unsupported methods
 boolean containsKey(java.lang.Object key)
          Inherited methods
 boolean containsValue(java.lang.Object value)
           
 java.util.Set<java.util.Map.Entry<K,V>> entrySet()
           
 V get(java.lang.Object key)
           
 boolean isEmpty()
           
 java.util.Set<K> keySet()
           
static
<K,V> ImmutableMapParameter<K,V>
of(K k0, V v0)
          Returns an ImmutableMapParameter instance containing a single entry.
static
<K,V> ImmutableMapParameter<K,V>
of(K k0, V v0, K k1, V v1)
          Returns an ImmutableMapParameter instance containing two entries.
static
<K,V> ImmutableMapParameter<K,V>
of(K k0, V v0, K k1, V v1, K k2, V v2)
          Returns an ImmutableMapParameter instance containing three entries.
static
<K,V> ImmutableMapParameter<K,V>
of(K k0, V v0, K k1, V v1, K k2, V v2, K k3, V v3)
          Returns an ImmutableMapParameter instance containing four entries.
static
<K,V> ImmutableMapParameter<K,V>
of(K k0, V v0, K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)
          Returns an ImmutableMapParameter instance containing five entries.
 V put(K key, V value)
           
 void putAll(java.util.Map<? extends K,? extends V> map)
           
 V remove(java.lang.Object key)
           
 int size()
           
 java.util.Collection<V> values()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Method Detail

builder

public static <K,V> ImmutableMapParameter.Builder<K,V> builder()
Returns a new MapParameterBuilder instance.


of

public static <K,V> ImmutableMapParameter<K,V> of(K k0,
                                                  V v0)
Returns an ImmutableMapParameter instance containing a single entry.

Parameters:
k0 - Key of the single entry.
v0 - Value of the single entry.

of

public static <K,V> ImmutableMapParameter<K,V> of(K k0,
                                                  V v0,
                                                  K k1,
                                                  V v1)
Returns an ImmutableMapParameter instance containing two entries.

Parameters:
k0 - Key of the first entry.
v0 - Value of the first entry.
k1 - Key of the second entry.
v1 - Value of the second entry.

of

public static <K,V> ImmutableMapParameter<K,V> of(K k0,
                                                  V v0,
                                                  K k1,
                                                  V v1,
                                                  K k2,
                                                  V v2)
Returns an ImmutableMapParameter instance containing three entries.

Parameters:
k0 - Key of the first entry.
v0 - Value of the first entry.
k1 - Key of the second entry.
v1 - Value of the second entry.
k2 - Key of the third entry.
v2 - Value of the third entry.

of

public static <K,V> ImmutableMapParameter<K,V> of(K k0,
                                                  V v0,
                                                  K k1,
                                                  V v1,
                                                  K k2,
                                                  V v2,
                                                  K k3,
                                                  V v3)
Returns an ImmutableMapParameter instance containing four entries.

Parameters:
k0 - Key of the first entry.
v0 - Value of the first entry.
k1 - Key of the second entry.
v1 - Value of the second entry.
k2 - Key of the third entry.
v2 - Value of the third entry.
k3 - Key of the fourth entry.
v3 - Value of the fourth entry.

of

public static <K,V> ImmutableMapParameter<K,V> of(K k0,
                                                  V v0,
                                                  K k1,
                                                  V v1,
                                                  K k2,
                                                  V v2,
                                                  K k3,
                                                  V v3,
                                                  K k4,
                                                  V v4)
Returns an ImmutableMapParameter instance containing five entries.

Parameters:
k0 - Key of the first entry.
v0 - Value of the first entry.
k1 - Key of the second entry.
v1 - Value of the second entry.
k2 - Key of the third entry.
v2 - Value of the third entry.
k3 - Key of the fourth entry.
v3 - Value of the fourth entry.
k4 - Key of the fifth entry.
v4 - Value of the fifth entry.

containsKey

public boolean containsKey(java.lang.Object key)
Inherited methods

Specified by:
containsKey in interface java.util.Map<K,V>

containsValue

public boolean containsValue(java.lang.Object value)
Specified by:
containsValue in interface java.util.Map<K,V>

entrySet

public java.util.Set<java.util.Map.Entry<K,V>> entrySet()
Specified by:
entrySet in interface java.util.Map<K,V>

get

public V get(java.lang.Object key)
Specified by:
get in interface java.util.Map<K,V>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Map<K,V>

keySet

public java.util.Set<K> keySet()
Specified by:
keySet in interface java.util.Map<K,V>

size

public int size()
Specified by:
size in interface java.util.Map<K,V>

values

public java.util.Collection<V> values()
Specified by:
values in interface java.util.Map<K,V>

clear

public void clear()
Unsupported methods

Specified by:
clear in interface java.util.Map<K,V>

put

public V put(K key,
             V value)
Specified by:
put in interface java.util.Map<K,V>

putAll

public void putAll(java.util.Map<? extends K,? extends V> map)
Specified by:
putAll in interface java.util.Map<K,V>

remove

public V remove(java.lang.Object key)
Specified by:
remove in interface java.util.Map<K,V>


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.