KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > cache > pojo > test > NetworkElement


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package org.jboss.cache.pojo.test;
8
9 import java.util.Date JavaDoc;
10
11 /**
12  * Can represent both software or devices (e.g., sensor).
13  * <p>This object is used to illustrate the pojo cache capability of PojoCache. Note the absence of <code>Serializable</code>
14  * interface.</p>
15  *
16  * @author <a HREF="mailto:ben.wang@jboss.com">Ben Wang</a>
17  */

18 // We are using JDK1.5 annotation.
19
@org.jboss.cache.pojo.annotation.Replicable
20 public class NetworkElement
21 {
22    // Unique id
23
int id_;
24    // Element type
25
int type_;
26    String JavaDoc name_;
27    int status_;
28    Date JavaDoc startDate_;
29    NetworkNode parentNode_;
30
31    public int getId()
32    {
33       return id_;
34    }
35
36    public void setId(int id)
37    {
38       id_ = id;
39    }
40
41    public int getType()
42    {
43       return type_;
44    }
45
46    public void setType(int type)
47    {
48       type_ = type;
49    }
50
51    public String JavaDoc getName()
52    {
53       return name_;
54    }
55
56    public void setName(String JavaDoc name)
57    {
58       name_ = name;
59    }
60
61    public int getStatus()
62    {
63       return status_;
64    }
65
66    public void setStatus(int status)
67    {
68       status_ = status;
69    }
70
71    public Date JavaDoc getStartDate()
72    {
73       return startDate_;
74    }
75
76    public void setStartDate(Date JavaDoc startDate)
77    {
78       startDate_ = startDate;
79    }
80
81    public NetworkNode getParentNode()
82    {
83       return parentNode_;
84    }
85
86    public void setParentNode(NetworkNode parentNode)
87    {
88       parentNode_ = parentNode;
89    }
90
91    public String JavaDoc toString()
92    {
93       StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
94       sb.append(" name= ").append(getName()).append(" status= ").append(getStatus());
95       sb.append(" parentNode= ").append(getParentNode().getName());
96       return sb.toString();
97    }
98
99 }
100
Popular Tags