001/*
002 * This library is part of OpenCms -
003 * the Open Source Content Management System
004 *
005 * Copyright (C) Alkacon Software (http://www.alkacon.com)
006 *
007 * This library is free software; you can redistribute it and/or
008 * modify it under the terms of the GNU Lesser General Public
009 * License as published by the Free Software Foundation; either
010 * version 2.1 of the License, or (at your option) any later version.
011 *
012 * This library is distributed in the hope that it will be useful,
013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015 * Lesser General Public License for more details.
016 *
017 * For further information about Alkacon Software, please see the
018 * company website: http://www.alkacon.com
019 *
020 * For further information about OpenCms, please see the
021 * project website: http://www.opencms.org
022 *
023 * You should have received a copy of the GNU Lesser General Public
024 * License along with this library; if not, write to the Free Software
025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
026 */
027
028package org.opencms.gwt.shared.alias;
029
030import org.opencms.util.CmsUUID;
031
032import com.google.gwt.user.client.rpc.IsSerializable;
033
034/**
035 * A class containing the data for a row of the rewrite alias table.<p>
036 */
037public class CmsRewriteAliasTableRow implements IsSerializable {
038
039    /** The error message for this rewrite alias. */
040    private String m_error;
041
042    /** The id of the alias. */
043    private CmsUUID m_id;
044
045    /** The alias mode. */
046    private CmsAliasMode m_mode;
047
048    /** The regular expression string used for matching. */
049    private String m_patternString;
050
051    /** The replacement string used when the regular expression matches. */
052    private String m_replacementString;
053
054    /**
055     * Default constructor, used for serialization.<p>
056     */
057    public CmsRewriteAliasTableRow() {
058
059        // nothing
060    }
061
062    /**
063     * Creates a new instance.<p>
064     *
065     * @param id the id of the alias
066     * @param patternString the regular expression used for matching the URI
067     * @param replacementString the replacement string used when the URI is matched
068     * @param mode the alias mode for this row
069     */
070    public CmsRewriteAliasTableRow(CmsUUID id, String patternString, String replacementString, CmsAliasMode mode) {
071
072        m_id = id;
073        m_patternString = patternString;
074        m_replacementString = replacementString;
075        m_mode = mode;
076    }
077
078    /**
079     * Gets the error message for this row.<p>
080     *
081     * @return the error message for this row
082     */
083    public String getError() {
084
085        return m_error;
086    }
087
088    /**
089     * Gets the id of the alias.<p>
090     *
091     * @return the id of the alias
092     */
093    public CmsUUID getId() {
094
095        return m_id;
096    }
097
098    /**
099     * Gets the alias mode for this row.<p>
100     *
101     * @return the alias mode for this row
102     */
103    public CmsAliasMode getMode() {
104
105        return m_mode;
106    }
107
108    /**
109     * Gets the regular expression string.<p>
110     *
111     * @return the regular expression string
112     */
113    public String getPatternString() {
114
115        return m_patternString;
116    }
117
118    /**
119     * Gets the string used to replace the string matching the regex.<p>
120     *
121     * @return the replacement string
122     */
123    public String getReplacementString() {
124
125        return m_replacementString;
126    }
127
128    /**
129     * Sets the error message for this row.<p>
130     *
131     * @param error the new error message
132     */
133    public void setError(String error) {
134
135        m_error = error;
136    }
137
138    /**
139     * Sets the id of this row.<p>
140     *
141     * @param id the new id
142     */
143    public void setId(CmsUUID id) {
144
145        m_id = id;
146    }
147
148    /**
149     * Sets the mode of this row.<p>
150     *
151     * @param mode the new mode
152     */
153    public void setMode(CmsAliasMode mode) {
154
155        m_mode = mode;
156    }
157
158    /**
159     * Sets the pattern of this row.<p>
160     *
161     * @param patternString the new pattern
162     */
163    public void setPatternString(String patternString) {
164
165        m_patternString = patternString;
166    }
167
168    /**
169     * Sets the replacement string for this row.<p>
170     *
171     * @param replacementString the new replacement string
172     */
173    public void setReplacementString(String replacementString) {
174
175        m_replacementString = replacementString;
176    }
177
178}