001    /**
002     * Copyright (c) 2000-present 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    import com.liferay.portal.kernel.util.StringPool;
019    
020    import java.io.Serializable;
021    
022    /**
023     * @author Brian Wing Shun Chan
024     */
025    public class LastPath implements Serializable {
026    
027            public LastPath(String contextPath, String path) {
028                    this(contextPath, path, StringPool.BLANK);
029            }
030    
031            public LastPath(String contextPath, String path, String parameters) {
032                    _contextPath = contextPath;
033                    _path = path;
034                    _parameters = parameters;
035            }
036    
037            public String getContextPath() {
038                    return _contextPath;
039            }
040    
041            public String getParameters() {
042                    return _parameters;
043            }
044    
045            public String getPath() {
046                    return _path;
047            }
048    
049            @Override
050            public String toString() {
051                    StringBundler sb = new StringBundler(5);
052    
053                    sb.append("{contextPath=");
054                    sb.append(_contextPath);
055                    sb.append(", path=");
056                    sb.append(_path);
057                    sb.append("}");
058    
059                    return sb.toString();
060            }
061    
062            private final String _contextPath;
063            private final String _parameters;
064            private final String _path;
065    
066    }