1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portlet.translator.model;
16  
17  import com.liferay.portal.kernel.util.StringPool;
18  
19  import java.io.Serializable;
20  import java.io.UnsupportedEncodingException;
21  
22  /**
23   * <a href="Translation.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   */
27  public class Translation implements Serializable {
28  
29      public Translation(String translationId, String fromText) {
30          _translationId = translationId;
31          setFromText(fromText);
32      }
33  
34      public Translation(String translationId, String fromText, String toText) {
35          _translationId = translationId;
36          setFromText(fromText);
37          setToText(toText);
38      }
39  
40      public String getTranslationId() {
41          return _translationId;
42      }
43  
44      public String getFromText() {
45          return _fromText;
46      }
47  
48      public void setFromText(String fromText) {
49          try {
50              _fromText = new String(fromText.getBytes(), StringPool.UTF8);
51          }
52          catch (UnsupportedEncodingException uee) {
53          }
54      }
55  
56      public String getToText() {
57          return _toText;
58      }
59  
60      public void setToText(String toText) {
61          try {
62              _toText = new String(toText.getBytes(), StringPool.UTF8);
63          }
64          catch (UnsupportedEncodingException uee) {
65          }
66      }
67  
68      private String _translationId;
69      private String _fromText;
70      private String _toText;
71  
72  }