KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sync4j > framework > engine > SyncProperty


1 /**
2  * Copyright (C) 2003-2005 Funambol
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */

18
19 package sync4j.framework.engine;
20
21 /**
22  * Represents a SyncBean property
23  *
24  * @version $Id: SyncProperty.java,v 1.6 2005/03/02 20:57:37 harrie Exp $
25  */

26 public class SyncProperty implements java.io.Serializable JavaDoc {
27     
28     // -------------------------------------------------------------- Properties
29

30     /**
31      * The property name
32      */

33     private String JavaDoc name = null;
34     public String JavaDoc getName(){
35         return this.name;
36     }
37     
38     public void setName(String JavaDoc name){
39         this.name = name;
40     }
41     
42     /**
43      * The property type
44      */

45     private String JavaDoc type = null;
46     public String JavaDoc getType(){
47         return type;
48     }
49     
50     public void setType(String JavaDoc type){
51         this.type = type;
52     }
53     
54     /**
55      * Is the property a key?
56      */

57     private boolean key = false;
58     public boolean isKey(){
59         return key;
60     }
61
62     /**
63      * The property value
64      */

65     private Object JavaDoc value = null;
66     public Object JavaDoc getValue(){
67         return value;
68     }
69
70     public void setValue(Object JavaDoc value){
71         this.value = value;
72     }
73     
74     public String JavaDoc toString() {
75         return String.valueOf(value);
76     }
77     
78     // ------------------------------------------------------------- Contructors
79

80     public SyncProperty(String JavaDoc name, Object JavaDoc value) {
81         this(name, value, value.getClass().getName());
82     }
83     
84     public SyncProperty(String JavaDoc name, Object JavaDoc value, String JavaDoc type) {
85         this.name = name;
86         this.value = value;
87         this.type = type;
88     }
89 }
Popular Tags