com.atlassian.bamboo.fieldvalue
Interface FieldValueItemHolder

All Known Implementing Classes:
DefaultFieldValueItemHolder

public interface FieldValueItemHolder

Interface that wraps list of FieldValueItem objects


Field Summary
static int DEFAULT_INT_VALUE
           
static java.lang.Integer DEFAULT_ROW
           
 
Method Summary
 void addFieldValueItems(java.lang.String keyField, FieldValueItemHolder fieldValueItemHolder)
          This method appends of the current holder with passed holder.
 FilteredMap asFilteredMap(java.lang.String prefix)
          Returns the current object represented as a series of key value pairs, if the FieldValueItem's key begins with the passed prefix.
 java.util.List asList()
          Returns the current object representation as a list of FieldValueItemHolder objects
 boolean getBoolean(java.lang.String key)
           
 int getInt(java.lang.String key)
          Returns the value as a int, using the DEFAULT_ROW as the row
 java.util.List getListOfStrings(java.lang.String key)
          Gets all of the matching keys as a List of Strings
 java.lang.String getString(java.lang.String key)
          Gets a string value for the passsed key, using the DEFAULT_ROW as the row.
 java.lang.String getString(java.lang.String key, java.lang.Integer row)
          Gets a string value for the passsed key and row
 void setFieldValueItem(FieldValueItem fieldValueItem)
          Adds a FieldValueItem to the list.
 void setFieldValueItem(java.lang.String key, boolean value)
          Adds a simple FieldValueItem for with the given keys.
 void setFieldValueItem(java.lang.String key, int value)
          Adds a simple FieldValueItem for with the given keys.
 void setFieldValueItems(FieldValueItemHolder fieldValueItemHolder)
          Sets the values of the passed holder into the current object.
 void setFieldValueItems(java.util.Map params)
          Sets the values of the passed holder into the current object.
 void setFieldValueItems(java.lang.String key, java.util.List values)
          Sets a list of strings given a key
 void setProperty(java.lang.String key, java.lang.String value)
          Adds a simple FieldValueItem for with the given keys.
 

Field Detail

DEFAULT_INT_VALUE

static final int DEFAULT_INT_VALUE
See Also:
Constant Field Values

DEFAULT_ROW

static final java.lang.Integer DEFAULT_ROW
Method Detail

setFieldValueItem

void setFieldValueItem(FieldValueItem fieldValueItem)
Adds a FieldValueItem to the list. Overrodes if exists.

Parameters:
fieldValueItem - - must not be null

setProperty

void setProperty(java.lang.String key,
                 java.lang.String value)
Adds a simple FieldValueItem for with the given keys. This will over-ride field if the property already exists.

Parameters:
key - - must not be null
value - - can be null

setFieldValueItem

void setFieldValueItem(java.lang.String key,
                       int value)
Adds a simple FieldValueItem for with the given keys. This will over-ride field if the property already exists. This will still store the int as a string

Parameters:
key - - must not be null
value -

setFieldValueItem

void setFieldValueItem(java.lang.String key,
                       boolean value)
Adds a simple FieldValueItem for with the given keys. This will over-ride field if the property already exists.

Parameters:
key - - must not be null
value -

setFieldValueItems

void setFieldValueItems(FieldValueItemHolder fieldValueItemHolder)
Sets the values of the passed holder into the current object. This will over-ride matching FieldValueItems

Parameters:
fieldValueItemHolder - - must not be null

setFieldValueItems

void setFieldValueItems(java.lang.String key,
                        java.util.List values)
Sets a list of strings given a key

Parameters:
key - not null
values - List of Strings. Nullable

setFieldValueItems

void setFieldValueItems(java.util.Map params)
Sets the values of the passed holder into the current object. This will over-ride matching FieldValueItems

Parameters:
params - - Map must not be null. It must also have a String for a key and value

addFieldValueItems

void addFieldValueItems(java.lang.String keyField,
                        FieldValueItemHolder fieldValueItemHolder)
This method appends of the current holder with passed holder. The key field, which must not be null, will be used as the identifier field to see which row the new fieldValueItemHolder will be added to. It will look at

Parameters:
keyField -
fieldValueItemHolder -

getString

java.lang.String getString(java.lang.String key)
Gets a string value for the passsed key, using the DEFAULT_ROW as the row.

Parameters:
key - must not be null
Returns:
the value - Null if value doesn't exist

getInt

int getInt(java.lang.String key)
Returns the value as a int, using the DEFAULT_ROW as the row

Parameters:
key - must not be null
Returns:
int value. DEFAULT_INT_VALUE if no key exists
Throws:
{@link - NumberFormatException]} if the value cannot be parsed.

getBoolean

boolean getBoolean(java.lang.String key)

getString

java.lang.String getString(java.lang.String key,
                           java.lang.Integer row)
Gets a string value for the passsed key and row

Parameters:
key - must not be null
row - must not be null
Returns:
the value - Null if value doesn't exist

getListOfStrings

java.util.List getListOfStrings(java.lang.String key)
Gets all of the matching keys as a List of Strings

Parameters:
key -
Returns:
List of Strings. Mepty if no values

asList

java.util.List asList()
Returns the current object representation as a list of FieldValueItemHolder objects

Returns:
List of FieldValueItemHolders. Never null.

asFilteredMap

FilteredMap asFilteredMap(java.lang.String prefix)
Returns the current object represented as a series of key value pairs, if the FieldValueItem's key begins with the passed prefix. If there are multiple FieldValueItem withe the same key, (ie. multiple rows) then the actual value returned is unpredictable (so obviously should be avoided). Values that do not match the prefix are not added

Parameters:
prefix - - must not be null
Returns:
FilteredMap filtered by the prefix. Empty map if no mataches.


Copyright © 2010 Atlassian. All Rights Reserved.