001    /**
002     * Copyright (c) 2000-2013 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.<String, String[]>emptyMap());
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 Map<String, String[]> getParameterMap() {
047                    return _parameterMap;
048            }
049    
050            public String getPath() {
051                    return _path;
052            }
053    
054            public void setContextPath(String contextPath) {
055                    _contextPath = contextPath;
056            }
057    
058            public void setParameterMap(Map<String, String[]> parameterMap) {
059                    _parameterMap = parameterMap;
060            }
061    
062            public void setPath(String path) {
063                    _path = path;
064            }
065    
066            @Override
067            public String toString() {
068                    StringBundler sb = new StringBundler(5);
069    
070                    sb.append("{contextPath=");
071                    sb.append(_contextPath);
072                    sb.append(", path=");
073                    sb.append(_path);
074                    sb.append("}");
075    
076                    return sb.toString();
077            }
078    
079            private String _contextPath;
080            private Map<String, String[]> _parameterMap;
081            private String _path;
082    
083    }