public class FieldImpl extends AbstractField
A Field
implementation.
Constructor and Description |
---|
FieldImpl(String name,
String value)
Creates a field.
|
FieldImpl(String name,
String value,
boolean formatValue)
Creates a field.
|
Modifier and Type | Method and Description |
---|---|
void |
addValue(String value)
Adds the specified value to the value of the field.
|
String |
getName()
Returns the name.
|
String |
getValue()
Returns the value.
|
void |
setValue(String value)
Sets the specified value as the value of the field.
|
formatValue, getFormattedValue, isEmpty, isNameless
public FieldImpl(String name, String value)
Creates a field.
The value won't be formatted.
name
- The name.value
- The value.IllegalArgumentException
- If any of the parameters is null
.public FieldImpl(String name, String value, boolean formatValue)
Creates a field.
name
- The name.value
- The value.formatValue
- The flag if the value should be stored as formatted. A
formatted value contains "." instead of empty lines.IllegalArgumentException
- If any of the parameters is null
.public String getName()
Returns the name.
Field.isEmpty()
,
Field.isNameless()
public String getValue()
Returns the value.
Field.isEmpty()
public void setValue(String value)
Sets the specified value as the value of the field.
value
- The value.IllegalArgumentException
- If the value is null
.public void addValue(String value)
Adds the specified value to the value of the field.
value
- The value which should be added to the field value.Copyright © 2015–2019. All rights reserved.