/****************************************************************
 * Licensed to the Apache Software Foundation (ASF) under one   *
 * or more contributor license agreements.  See the NOTICE file *
 * distributed with this work for additional information        *
 * regarding copyright ownership.  The ASF licenses this file   *
 * to you under the Apache License, Version 2.0 (the            *
 * "License"); you may not use this file except in compliance   *
 * with the License.  You may obtain a copy of the License at   *
 *                                                              *
 *   http://www.apache.org/licenses/LICENSE-2.0                 *
 *                                                              *
 * Unless required by applicable law or agreed to in writing,   *
 * software distributed under the License is distributed on an  *
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
 * KIND, either express or implied.  See the License for the    *
 * specific language governing permissions and limitations      *
 * under the License.                                           *
 ****************************************************************/

package org.apache.james.mailbox.torque.om;

import org.apache.james.mailbox.store.mail.model.Header;
import org.apache.torque.om.Persistent;

/**
 * The skeleton for this class was autogenerated by Torque on:
 * 
 * [Tue Sep 05 21:34:06 CEST 2006]
 * 
 * You should add additional methods to this class to meet the application
 * requirements. This class will only be generated as long as it does not
 * already exist in the output directory.
 *
 * @deprecated Torque implementation will get removed in the next release
 */
@Deprecated()
public class MessageHeader extends
        org.apache.james.mailbox.torque.om.BaseMessageHeader implements
        Persistent,Header {
    private static final long serialVersionUID = -9191792349506771474L;

    public MessageHeader() {
        super();
    }

    public MessageHeader(final String field, final String value) {
        super();
        setField(field);
        setValue(value);
    }

    public MessageHeader(final String field, final String value, int position) {
        super();
        setField(field);
        setValue(value);
        setLineNumber(position);
    }

    /*
     * (non-Javadoc)
     * @see org.apache.james.mailbox.store.mail.model.Header#getFieldName()
     */
	public String getFieldName() {
		return getField();
	}

	/*
	 * (non-Javadoc)
	 * @see java.lang.Comparable#compareTo(java.lang.Object)
	 */
	public int compareTo(Header header) {
        final int result = getLineNumber() - header.getLineNumber();
        return result;
    }
}
