T
- the type of data to be stored in the fieldspublic class CustomFields<T>
extends java.lang.Object
Constructor and Description |
---|
CustomFields()
Creates an empty set of custom fields.
|
CustomFields(java.util.List<T> initialValues)
Creates a set of custom fields with the specified values.
|
Modifier and Type | Method and Description |
---|---|
void |
add(int position,
T value)
Adds a new value to this custom field list.
|
java.lang.String |
exportAsString()
Returns a string representation of the list of values.
|
T |
get(int number)
Gets the value of a specified custom field.
|
void |
remove(int position)
Removes a value from this custom field list.
|
void |
set(int number,
T value)
Sets a specified custom field to a specified value.
|
void |
setSize(int newSize,
T fillWith)
Sets the size of the list of custom fields.
|
int |
size()
Returns the number of values in this list.
|
void |
swapAdjacent(int position)
Swaps the values in two adjacent positions within this custom field list.
|
java.util.List<java.lang.String> |
toStrings() |
public CustomFields(java.util.List<T> initialValues)
initialValues
- the values with which to initialize the fieldspublic CustomFields()
public void set(int number, T value)
number
- the index of the field to setvalue
- the value to which to set the fieldpublic T get(int number)
null
is returnednumber
- the index of a fieldnull
if there is no such fieldpublic void setSize(int newSize, T fillWith)
newSize
- the new size of the custom field listfillWith
- the value with which to fill the listpublic void add(int position, T value)
position
- the position at which to insert the new valuevalue
- the value to insertpublic void remove(int position)
position
- the index of the value to removepublic void swapAdjacent(int position)
position
- the first of the positions to swap; its value will be
swapped with the next valuepublic java.lang.String exportAsString()
public java.util.List<java.lang.String> toStrings()
public int size()