001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portlet.translator.model;
016    
017    import com.liferay.portal.kernel.util.StringPool;
018    
019    import java.io.Serializable;
020    import java.io.UnsupportedEncodingException;
021    
022    /**
023     * @author Brian Wing Shun Chan
024     */
025    public class Translation implements Serializable {
026    
027            public Translation(String translationId, String fromText) {
028                    _translationId = translationId;
029                    setFromText(fromText);
030            }
031    
032            public Translation(String translationId, String fromText, String toText) {
033                    _translationId = translationId;
034                    setFromText(fromText);
035                    setToText(toText);
036            }
037    
038            public String getTranslationId() {
039                    return _translationId;
040            }
041    
042            public String getFromText() {
043                    return _fromText;
044            }
045    
046            public void setFromText(String fromText) {
047                    try {
048                            _fromText = new String(fromText.getBytes(), StringPool.UTF8);
049                    }
050                    catch (UnsupportedEncodingException uee) {
051                    }
052            }
053    
054            public String getToText() {
055                    return _toText;
056            }
057    
058            public void setToText(String toText) {
059                    try {
060                            _toText = new String(toText.getBytes(), StringPool.UTF8);
061                    }
062                    catch (UnsupportedEncodingException uee) {
063                    }
064            }
065    
066            private String _translationId;
067            private String _fromText;
068            private String _toText;
069    
070    }