View Javadoc

1   /**
2    *
3    * Copyright 2003-2006 The Apache Software Foundation
4    *
5    *  Licensed under the Apache License, Version 2.0 (the "License");
6    *  you may not use this file except in compliance with the License.
7    *  You may obtain a copy of the License at
8    *
9    *     http://www.apache.org/licenses/LICENSE-2.0
10   *
11   *  Unless required by applicable law or agreed to in writing, software
12   *  distributed under the License is distributed on an "AS IS" BASIS,
13   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   *  See the License for the specific language governing permissions and
15   *  limitations under the License.
16   */
17  
18  package javax.mail;
19  
20  /**
21   * Class representing a header field.
22   *
23   * @version $Rev: 421852 $ $Date: 2006-07-14 03:02:19 -0700 (Fri, 14 Jul 2006) $
24   */
25  public class Header {
26      /**
27       * The name of the header.
28       */
29      protected String name;
30      /**
31       * The header value (can be null).
32       */
33      protected String value;
34  
35      /**
36       * Constructor initializing all immutable fields.
37       *
38       * @param name  the name of this header
39       * @param value the value of this header
40       */
41      public Header(String name, String value) {
42          this.name = name;
43          this.value = value;
44      }
45  
46      /**
47       * Return the name of this header.
48       *
49       * @return the name of this header
50       */
51      public String getName() {
52          return name;
53      }
54  
55      /**
56       * Return the value of this header.
57       *
58       * @return the value of this header
59       */
60      public String getValue() {
61          return value;
62      }
63  }