| Header.java |
1 /**
2 * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3 *
4 * This library is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU Lesser General Public License as published by the Free
6 * Software Foundation; either version 2.1 of the License, or (at your option)
7 * any later version.
8 *
9 * This library is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12 * details.
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 == _dateValue) {
66 return String.valueOf(_intValue);
67 }
68 else if (_type == _dateValue) {
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 }