package org.apache.commons.httpclient;

public class Header extends NameValuePair {
    private boolean a;

    public Header() {
        this(null, null);
    }

    public Header(String name, String value) {
        super(name, value);
        this.a = false;
    }

    public Header(String name, String value, boolean isAutogenerated) {
        super(name, value);
        this.a = false;
        this.a = isAutogenerated;
    }

    public String toExternalForm() {
        return new StringBuffer().append(getName() == null ? "" : getName()).append(": ").append(getValue() == null ? "" : getValue()).append("\r\n").toString();
    }

    @Override // org.apache.commons.httpclient.NameValuePair
    public String toString() {
        return toExternalForm();
    }

    public HeaderElement[] getValues() throws HttpException {
        return HeaderElement.parse(getValue());
    }

    public HeaderElement[] getElements() {
        return HeaderElement.parseElements(getValue());
    }

    public boolean isAutogenerated() {
        return this.a;
    }
}
