1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
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  }