001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.servlet;
016    
017    import java.io.Serializable;
018    
019    /**
020     * @author Michael Young
021     */
022    public class Header implements Serializable {
023    
024            public static final int INTEGER_TYPE = 1;
025    
026            public static final int DATE_TYPE = 2;
027    
028            public static final int STRING_TYPE = 3;
029    
030            public long getDateValue() {
031                    return _dateValue;
032            }
033    
034            public void setDateValue(long dateValue) {
035                    _dateValue = dateValue;
036            }
037    
038            public int getIntValue() {
039                    return _intValue;
040            }
041    
042            public void setIntValue(int intValue) {
043                    _intValue = intValue;
044            }
045    
046            public String getStringValue() {
047                    return _stringValue;
048            }
049    
050            public void setStringValue(String stringValue) {
051                    _stringValue = stringValue;
052            }
053    
054            public int getType() {
055                    return _type;
056            }
057    
058            public void setType(int type) {
059                    _type = type;
060            }
061    
062            public String toString() {
063                    if (_type == DATE_TYPE) {
064                            return String.valueOf(_dateValue);
065                    }
066                    else if (_type == INTEGER_TYPE) {
067                            return String.valueOf(_intValue);
068                    }
069                    else {
070                            return _stringValue;
071                    }
072            }
073    
074            private int _intValue;
075            private long _dateValue;
076            private String _stringValue;
077            private int _type;
078    
079    }