public interface Header extends Iterable<Field>
Modifier and Type | Method and Description |
---|---|
void |
addField(Field field)
Adds a field to the end of the list of fields.
|
Field |
getField(String name)
Gets a
Field given a field name. |
List<Field> |
getFields()
Gets the fields of this header.
|
List<Field> |
getFields(String name)
Gets all
Field s having the specified field name. |
Iterator<Field> |
iterator()
Returns an iterator over the list of fields of this header.
|
int |
removeFields(String name)
Removes all
Field s having the specified field name. |
void |
setField(Field field)
Sets or replaces a field.
|
void addField(Field field)
field
- the field to add.List<Field> getFields()
Field
objects.Field getField(String name)
Field
given a field name. If there are multiple
such fields defined in this header the first one will be returned.name
- the field name (e.g. From, Subject).null
if none found.List<Field> getFields(String name)
Field
s having the specified field name.name
- the field name (e.g. From, Subject).int removeFields(String name)
Field
s having the specified field name.name
- the field name (e.g. From, Subject).void setField(Field field)
Header
does not already contain a header field of
the same name as the given field then it is added to the end of the list
of fields (same behavior as addField(Field)
). Otherwise the
first occurrence of a field with the same name is replaced by the given
field and all further occurrences are removed.field
- the field to set.Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.