1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.util.servlet;
16  
17  import java.io.Serializable;
18  
19  /**
20   * <a href="Header.java.html"><b><i>View Source</i></b></a>
21   *
22   * @author Michael Young
23   */
24  public class Header implements Serializable {
25  
26      public static final int INTEGER_TYPE = 1;
27  
28      public static final int DATE_TYPE = 2;
29  
30      public static final int STRING_TYPE = 3;
31  
32      public long getDateValue() {
33          return _dateValue;
34      }
35  
36      public void setDateValue(long dateValue) {
37          _dateValue = dateValue;
38      }
39  
40      public int getIntValue() {
41          return _intValue;
42      }
43  
44      public void setIntValue(int intValue) {
45          _intValue = intValue;
46      }
47  
48      public String getStringValue() {
49          return _stringValue;
50      }
51  
52      public void setStringValue(String stringValue) {
53          _stringValue = stringValue;
54      }
55  
56      public int getType() {
57          return _type;
58      }
59  
60      public void setType(int type) {
61          _type = type;
62      }
63  
64      public String toString() {
65          if (_type == DATE_TYPE) {
66              return String.valueOf(_dateValue);
67          }
68          else if (_type == INTEGER_TYPE) {
69              return String.valueOf(_intValue);
70          }
71          else {
72              return _stringValue;
73          }
74      }
75  
76      private int _intValue;
77      private long _dateValue;
78      private String _stringValue;
79      private int _type;
80  
81  }