public class DefaultFieldValueItemHolder extends Object implements FieldValueItemHolder
DEFAULT_INT_VALUE, DEFAULT_ROW
Constructor and Description |
---|
DefaultFieldValueItemHolder() |
DefaultFieldValueItemHolder(List fieldValueItems) |
Modifier and Type | Method and Description |
---|---|
void |
addFieldValueItems(String keyField,
FieldValueItemHolder fieldValueItemHolder)
This method appends of the current holder with passed holder.
|
FilteredMap |
asFilteredMap(String prefix)
Returns the current object represented as a series of key value pairs, if the
FieldValueItem 's key begins
with the passed prefix. |
List |
asList()
Returns the current object representation as a list of FieldValueItemHolder objects
|
boolean |
getBoolean(String key) |
FieldValueItem |
getFieldItemValue(String key,
Integer row) |
int |
getInt(String key)
Returns the value as a int, using the
FieldValueItemHolder.DEFAULT_ROW as the row |
List |
getListOfStrings(String key)
|
String |
getString(String key)
Gets a string value for the passsed key, using the
FieldValueItemHolder.DEFAULT_ROW as the row. |
String |
getString(String key,
Integer row)
Gets a string value for the passsed key and row
|
void |
setFieldValueItem(FieldValueItem fieldValueItem)
Adds a
FieldValueItem to the list. |
void |
setFieldValueItem(String key,
boolean value)
Adds a simple
FieldValueItem for with the given keys. |
void |
setFieldValueItem(String key,
int value)
Adds a simple
FieldValueItem for with the given keys. |
void |
setFieldValueItem(String key,
String value,
int row) |
void |
setFieldValueItems(FieldValueItemHolder fieldValueItemHolder)
Sets the values of the passed holder into the current object.
|
void |
setFieldValueItems(List<?> fieldValueItems) |
void |
setFieldValueItems(Map params)
Sets the values of the passed holder into the current object.
|
void |
setFieldValueItems(String key,
List values)
Sets a list of strings given a key
|
void |
setProperty(String key,
String value)
Adds a simple
FieldValueItem for with the given keys. |
public DefaultFieldValueItemHolder()
public DefaultFieldValueItemHolder(List fieldValueItems)
public void setFieldValueItem(FieldValueItem fieldValueItem)
FieldValueItemHolder
FieldValueItem
to the list. Overrodes if exists.setFieldValueItem
in interface FieldValueItemHolder
fieldValueItem
- - must not be nullpublic void setProperty(String key, String value)
FieldValueItemHolder
FieldValueItem
for with the given keys. This will over-ride field if the
property already exists.setProperty
in interface FieldValueItemHolder
key
- - must not be nullvalue
- - can be nullpublic void setFieldValueItem(String key, int value)
FieldValueItemHolder
FieldValueItem
for with the given keys. This will over-ride field if the
property already exists. This will still store the int as a stringsetFieldValueItem
in interface FieldValueItemHolder
key
- - must not be nullpublic void setFieldValueItem(String key, boolean value)
FieldValueItemHolder
FieldValueItem
for with the given keys. This will over-ride field if the
property already exists.setFieldValueItem
in interface FieldValueItemHolder
key
- - must not be nullpublic void setFieldValueItems(FieldValueItemHolder fieldValueItemHolder)
FieldValueItemHolder
FieldValueItem
ssetFieldValueItems
in interface FieldValueItemHolder
fieldValueItemHolder
- - must not be nullpublic void setFieldValueItems(String key, List values)
FieldValueItemHolder
setFieldValueItems
in interface FieldValueItemHolder
key
- not nullvalues
- List
of Strings. Nullablepublic void setFieldValueItems(List<?> fieldValueItems)
public void setFieldValueItems(Map params)
FieldValueItemHolder
FieldValueItem
ssetFieldValueItems
in interface FieldValueItemHolder
params
- - Map must not be null. It must also have a String for a key and valuepublic void addFieldValueItems(String keyField, FieldValueItemHolder fieldValueItemHolder)
FieldValueItemHolder
addFieldValueItems
in interface FieldValueItemHolder
public List asList()
FieldValueItemHolder
asList
in interface FieldValueItemHolder
List
of FieldValueItemHolder
s. Never null.public FilteredMap asFilteredMap(String prefix)
FieldValueItemHolder
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 addedasFilteredMap
in interface FieldValueItemHolder
prefix
- - must not be nullFilteredMap
filtered by the prefix. Empty map if no mataches.public String getString(String key)
FieldValueItemHolder
FieldValueItemHolder.DEFAULT_ROW
as the row.getString
in interface FieldValueItemHolder
key
- must not be nullpublic int getInt(String key)
FieldValueItemHolder
FieldValueItemHolder.DEFAULT_ROW
as the rowgetInt
in interface FieldValueItemHolder
key
- must not be nullFieldValueItemHolder.DEFAULT_INT_VALUE
if no key existspublic boolean getBoolean(String key)
getBoolean
in interface FieldValueItemHolder
public String getString(String key, Integer row)
FieldValueItemHolder
getString
in interface FieldValueItemHolder
key
- must not be nullrow
- must not be nullpublic List getListOfStrings(String key)
FieldValueItemHolder
getListOfStrings
in interface FieldValueItemHolder
List
of String
s. Mepty if no valuespublic FieldValueItem getFieldItemValue(String key, Integer row)
Copyright © 2017 Atlassian Software Systems Pty Ltd. All rights reserved.