Skip to content
Permalink
Browse files
Merge pull request #40 from chibenwa/MIME4J-299
MIME4J-299 Access to the Header map
  • Loading branch information
jochenw committed May 25, 2021
2 parents e5a2cac + 293714f commit 0a0733fb6b0fac6ebab2a2bf2aea32a387a889ed
Showing 2 changed files with 22 additions and 0 deletions.
@@ -21,6 +21,7 @@

import java.util.Iterator;
import java.util.List;
import java.util.Map;

import org.apache.james.mime4j.stream.Field;

@@ -44,6 +45,15 @@ public interface Header extends Iterable<Field> {
*/
List<Field> getFields();

/**
* Gets the fields of this header. The returned map will not be
* modifiable. For each header name, values are ordered by which
* they appear in the underlying entity.
*
* @return the map of <code>Field</code> objects indexed by names.
*/
Map<String, List<Field>> getFieldsAsMap();

/**
* Gets a <code>Field</code> given a field name. If there are multiple
* such fields defined in this header the first one will be returned.
@@ -87,6 +87,18 @@ public List<Field> getFields() {
return Collections.unmodifiableList(fields);
}

/**
* Gets the fields of this header. The returned map will not be
* modifiable. For each header name, values are ordered by which
* they appear in the underlying entity.
*
* @return the map of <code>Field</code> objects indexed by names.
*/
@Override
public Map<String, List<Field>> getFieldsAsMap() {
return Collections.unmodifiableMap(fieldMap);
}

/**
* Gets a <code>Field</code> given a field name. If there are multiple
* such fields defined in this header the first one will be returned.

0 comments on commit 0a0733f

Please sign in to comment.