KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openi > util > NameValue


1 /*********************************************************************************
2  * The contents of this file are subject to the OpenI Public License Version 1.0
3  * ("License"); You may not use this file except in compliance with the
4  * License. You may obtain a copy of the License at
5  * http://www.openi.org/docs/LICENSE.txt
6  *
7  * Software distributed under the License is distributed on an "AS IS" basis,
8  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
9  * the specific language governing rights and limitations under the License.
10  *
11  * The Original Code is: OpenI Open Source
12  *
13  * The Initial Developer of the Original Code is Loyalty Matrix, Inc.
14  * Portions created by Loyalty Matrix, Inc. are
15  * Copyright (C) 2005 Loyalty Matrix, Inc.; All Rights Reserved.
16  *
17  * Contributor(s): ______________________________________.
18  *
19  ********************************************************************************/

20 package org.openi.util;
21
22 import java.io.*;
23
24
25 /**
26  *
27  */

28 public class NameValue implements Serializable {
29     private String JavaDoc displayName;
30     private Object JavaDoc value;
31
32     public NameValue(String JavaDoc name, Object JavaDoc value) {
33         this.displayName = name;
34         this.value = value;
35     }
36
37     /**
38      * @return Returns the displayName.
39      */

40     public String JavaDoc getDisplayName() {
41         return displayName;
42     }
43
44     /**
45      * @param displayName The displayName to set.
46      */

47     public void setDisplayName(String JavaDoc displayName) {
48         this.displayName = displayName;
49     }
50
51     /**
52      * @return Returns the value.
53      */

54     public Object JavaDoc getValue() {
55         return value;
56     }
57
58     /**
59      * @param value The value to set.
60      */

61     public void setValue(Object JavaDoc value) {
62         this.value = value;
63     }
64
65     public String JavaDoc toString() {
66         StringBuffer JavaDoc buffer = new StringBuffer JavaDoc();
67
68         if (this != null) {
69             buffer.append("name=");
70             buffer.append(String.valueOf(this.getDisplayName()));
71             buffer.append(", ");
72             buffer.append("value=");
73             buffer.append(String.valueOf(this.getValue()));
74         }
75
76         return buffer.toString();
77     }
78 }
79
Popular Tags