001 /**
002 *
003 * Copyright 2003-2006 The Apache Software Foundation
004 *
005 * Licensed under the Apache License, Version 2.0 (the "License");
006 * you may not use this file except in compliance with the License.
007 * You may obtain a copy of the License at
008 *
009 * http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017
018 package javax.mail;
019
020 /**
021 * Class representing a header field.
022 *
023 * @version $Rev: 421852 $ $Date: 2006-07-14 03:02:19 -0700 (Fri, 14 Jul 2006) $
024 */
025 public class Header {
026 /**
027 * The name of the header.
028 */
029 protected String name;
030 /**
031 * The header value (can be null).
032 */
033 protected String value;
034
035 /**
036 * Constructor initializing all immutable fields.
037 *
038 * @param name the name of this header
039 * @param value the value of this header
040 */
041 public Header(String name, String value) {
042 this.name = name;
043 this.value = value;
044 }
045
046 /**
047 * Return the name of this header.
048 *
049 * @return the name of this header
050 */
051 public String getName() {
052 return name;
053 }
054
055 /**
056 * Return the value of this header.
057 *
058 * @return the value of this header
059 */
060 public String getValue() {
061 return value;
062 }
063 }