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;
16  
17  import java.io.Serializable;
18  
19  /**
20   * <a href="Preference.java.html"><b><i>View Source</i></b></a>
21   *
22   * @author Brian Wing Shun Chan
23   */
24  public class Preference implements Cloneable, Serializable {
25  
26      public Preference(String name, String value) {
27          this(name, new String[] {value});
28      }
29  
30      public Preference(String name, String value, boolean readOnly) {
31          this(name, new String[] {value}, readOnly);
32      }
33  
34      public Preference(String name, String[] values) {
35          this(name, values, false);
36      }
37  
38      public Preference(String name, String[] values, boolean readOnly) {
39          _name = name;
40          _values = values;
41          _readOnly = readOnly;
42      }
43  
44      public String getName() {
45          return _name;
46      }
47  
48      public String[] getValues() {
49          return _values;
50      }
51  
52      public void setValues(String[] values) {
53          _values = values;
54      }
55  
56      public boolean getReadOnly() {
57          return _readOnly;
58      }
59  
60      public boolean isReadOnly() {
61          return _readOnly;
62      }
63  
64      public Object clone() {
65          return new Preference(_name, _values, _readOnly);
66      }
67  
68      private String _name;
69      private String[] _values;
70      private boolean _readOnly;
71  
72  }