001    /**
002     * Copyright (c) 2000-2012 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 DATE_TYPE = 2;
025    
026            public static final int INTEGER_TYPE = 1;
027    
028            public static final int STRING_TYPE = 3;
029    
030            public long getDateValue() {
031                    return _dateValue;
032            }
033    
034            public int getIntValue() {
035                    return _intValue;
036            }
037    
038            public String getStringValue() {
039                    return _stringValue;
040            }
041    
042            public int getType() {
043                    return _type;
044            }
045    
046            public void setDateValue(long dateValue) {
047                    _dateValue = dateValue;
048            }
049    
050            public void setIntValue(int intValue) {
051                    _intValue = intValue;
052            }
053    
054            public void setStringValue(String stringValue) {
055                    _stringValue = stringValue;
056            }
057    
058            public void setType(int type) {
059                    _type = type;
060            }
061    
062            @Override
063            public String toString() {
064                    if (_type == DATE_TYPE) {
065                            return String.valueOf(_dateValue);
066                    }
067                    else if (_type == INTEGER_TYPE) {
068                            return String.valueOf(_intValue);
069                    }
070                    else {
071                            return _stringValue;
072                    }
073            }
074    
075            private long _dateValue;
076            private int _intValue;
077            private String _stringValue;
078            private int _type;
079    
080    }