dom/src/main/java/org/apache/james/mime4j/internal/AbstractEntityBuilder.java [143:176]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public List<Field> getFields(final String name) {
        final String lowerCaseName = name.toLowerCase(Locale.US);
        final List<Field> l = fieldMap.get(lowerCaseName);
        final List<Field> results;
        if (l == null || l.isEmpty()) {
            results = Collections.emptyList();
        } else {
            results = Collections.unmodifiableList(l);
        }
        return results;
    }

    /**
     * Gets all <code>Field</code>s having the specified field name
     * and of the given type.
     *
     * @param name the field name (e.g. From, Subject).
     * @param clazz the field class.
     * @return the list of fields.
     */
    public <F extends Field> List<F> getFields(final String name, final Class<F> clazz) {
        final String lowerCaseName = name.toLowerCase(Locale.US);
        final List<Field> l = fieldMap.get(lowerCaseName);
        if (l == null) {
            return Collections.emptyList();
        }
        final List<F> results = new ArrayList<F>();
        for (int i = 0; i < l.size(); i++) {
            Field field = l.get(i);
            if (clazz.isInstance(field)) {
                results.add(clazz.cast(field));
            }
        }
        return results;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



dom/src/main/java/org/apache/james/mime4j/message/AbstractHeader.java [146:179]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public List<Field> getFields(final String name) {
        final String lowerCaseName = name.toLowerCase(Locale.US);
        final List<Field> l = fieldMap.get(lowerCaseName);
        final List<Field> results;
        if (l == null || l.isEmpty()) {
            results = Collections.emptyList();
        } else {
            results = Collections.unmodifiableList(l);
        }
        return results;
    }

    /**
     * Gets all <code>Field</code>s having the specified field name
     * and of the given type.
     *
     * @param name the field name (e.g. From, Subject).
     * @param clazz the field class.
     * @return the list of fields.
     */
    public <F extends Field> List<F> getFields(final String name, final Class<F> clazz) {
        final String lowerCaseName = name.toLowerCase(Locale.US);
        final List<Field> l = fieldMap.get(lowerCaseName);
        if (l == null) {
            return Collections.emptyList();
        }
        final List<F> results = new ArrayList<F>();
        for (int i = 0; i < l.size(); i++) {
            Field field = l.get(i);
            if (clazz.isInstance(field)) {
                results.add(clazz.cast(field));
            }
        }
        return results;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



