com.atlassian.jira.ofbiz
Class FieldMap

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<String,Object>
          extended by com.atlassian.jira.ofbiz.FieldMap
All Implemented Interfaces:
Serializable, Cloneable, Map<String,Object>

@PublicApi
public class FieldMap
extends HashMap<String,Object>

Convenience class to use for field maps in OfBizDelegator

Since:
v4.0
See Also:
OfBizDelegator, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Constructor Summary
FieldMap()
           
FieldMap(Map<String,?> m)
           
FieldMap(String fieldName, Object fieldValue)
           
 
Method Summary
 FieldMap add(String key, Object value)
          Adds the given key-value pair to the Map, and returns this in order to allow fluent syntax.
 FieldMap addAll(Map<String,?> m)
          Adds all of the key-value pairs from the supplied map to this Map and returns this in order to allow fluent syntax.
static FieldMap build(String fieldName, Object fieldValue)
           
static FieldMap build(String name1, Object value1, String name2, Object value2)
           
static FieldMap build(String name1, Object value1, String name2, Object value2, String name3, Object value3)
           
static FieldMap build(String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4)
           
static FieldMap build(String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4, String name5, Object value5)
           
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

FieldMap

public FieldMap()

FieldMap

public FieldMap(Map<String,?> m)

FieldMap

public FieldMap(String fieldName,
                Object fieldValue)
Method Detail

add

public FieldMap add(String key,
                    Object value)
Adds the given key-value pair to the Map, and returns this in order to allow fluent syntax.

This method allows you to write code like the following:
FieldMap fieldMap = new FieldMap("id", 12L).add("name", "Fred");

Parameters:
key - key with which the specified value is to be associated.
value - value to be associated with the specified key.
Returns:
This FieldMap.

addAll

public FieldMap addAll(Map<String,?> m)
Adds all of the key-value pairs from the supplied map to this Map and returns this in order to allow fluent syntax.

This method allows you to write code like the following:
FieldMap defaults = new FieldMap("name", "Fred").add("description", "Fred's stuff"); FieldMap fieldMap = new FieldMap("id", 12L).addAll(defaults);

Parameters:
m - the map of values to add
Returns:
This FieldMap.

build

public static FieldMap build(String fieldName,
                             Object fieldValue)

build

public static FieldMap build(String name1,
                             Object value1,
                             String name2,
                             Object value2)

build

public static FieldMap build(String name1,
                             Object value1,
                             String name2,
                             Object value2,
                             String name3,
                             Object value3)

build

public static FieldMap build(String name1,
                             Object value1,
                             String name2,
                             Object value2,
                             String name3,
                             Object value3,
                             String name4,
                             Object value4)

build

public static FieldMap build(String name1,
                             Object value1,
                             String name2,
                             Object value2,
                             String name3,
                             Object value3,
                             String name4,
                             Object value4,
                             String name5,
                             Object value5)


Copyright © 2002-2014 Atlassian. All Rights Reserved.