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.struts;
016    
017    import com.liferay.portal.kernel.util.StringBundler;
018    
019    import java.io.Serializable;
020    
021    import java.util.Collections;
022    import java.util.LinkedHashMap;
023    import java.util.Map;
024    
025    /**
026     * @author Brian Wing Shun Chan
027     */
028    public class LastPath implements Serializable {
029    
030            public LastPath(String contextPath, String path) {
031                    this(contextPath, path, Collections.EMPTY_MAP);
032            }
033    
034            public LastPath(
035                    String contextPath, String path, Map<String, String[]> parameterMap) {
036    
037                    _contextPath = contextPath;
038                    _path = path;
039                    _parameterMap = new LinkedHashMap<String, String[]>(parameterMap);
040            }
041    
042            public String getContextPath() {
043                    return _contextPath;
044            }
045    
046            public void setContextPath(String contextPath) {
047                    _contextPath = contextPath;
048            }
049    
050            public String getPath() {
051                    return _path;
052            }
053    
054            public void setPath(String path) {
055                    _path = path;
056            }
057    
058            public Map<String, String[]> getParameterMap() {
059                    return _parameterMap;
060            }
061    
062            public void setParameterMap(Map<String, String[]> parameterMap) {
063                    _parameterMap = parameterMap;
064            }
065    
066            public String toString() {
067                    StringBundler sb = new StringBundler(5);
068    
069                    sb.append("{contextPath=");
070                    sb.append(_contextPath);
071                    sb.append(", path=");
072                    sb.append(_path);
073                    sb.append("}");
074    
075                    return sb.toString();
076            }
077    
078            private String _contextPath;
079            private String _path;
080            private Map<String, String[]> _parameterMap;
081    
082    }