KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > info > jtrac > domain > Space


1 /*
2  * Copyright 2002-2005 the original author or authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package info.jtrac.domain;
18
19 import java.io.Serializable JavaDoc;
20
21 import static info.jtrac.domain.Field.Name.*;
22 import java.util.ArrayList JavaDoc;
23 import java.util.List JavaDoc;
24 import java.util.Map JavaDoc;
25
26 /**
27  * A JTrac installation can be divided into different project
28  * areas or workspaces. The Space entity represents this concept.
29  * The Metdata of a Space determines the type of
30  * Items contained within the space. Users can be mapped to a
31  * space with different access permissions.
32  */

33 public class Space implements Serializable JavaDoc {
34     
35     private long id;
36     private int version;
37     private Integer JavaDoc type;
38     private String JavaDoc prefixCode;
39     private String JavaDoc name;
40     private String JavaDoc description;
41     private boolean guestAllowed;
42     private SpaceSequence spaceSequence = new SpaceSequence();
43     private Metadata metadata = new Metadata();
44     
45     //=======================================================
46

47     public int getVersion() {
48         return version;
49     }
50
51     public void setVersion(int version) {
52         this.version = version;
53     }
54     
55     public SpaceSequence getSpaceSequence() {
56         return spaceSequence;
57     }
58
59     public void setSpaceSequence(SpaceSequence spaceSequence) {
60         this.spaceSequence = spaceSequence;
61     }
62     
63     public String JavaDoc getPrefixCode() {
64         return prefixCode;
65     }
66
67     public void setPrefixCode(String JavaDoc prefixCode) {
68         this.prefixCode = prefixCode;
69     }
70
71     public String JavaDoc getName() {
72         return name;
73     }
74
75     public void setName(String JavaDoc name) {
76         this.name = name;
77     }
78     
79     public String JavaDoc getDescription() {
80         return description;
81     }
82
83     public void setDescription(String JavaDoc description) {
84         this.description = description;
85     }
86
87     public Metadata getMetadata() {
88         return metadata;
89     }
90
91     public void setMetadata(Metadata metadata) {
92         this.metadata = metadata;
93     }
94
95     public long getId() {
96         return id;
97     }
98
99     public void setId(long id) {
100         this.id = id;
101     }
102
103     public Integer JavaDoc getType() {
104         return type;
105     }
106
107     public void setType(Integer JavaDoc type) {
108         this.type = type;
109     }
110     
111     public boolean isGuestAllowed() {
112         return guestAllowed;
113     }
114
115     public void setGuestAllowed(boolean guestAllowed) {
116         this.guestAllowed = guestAllowed;
117     }
118     
119     @Override JavaDoc
120     public String JavaDoc toString() {
121         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
122         sb.append("id [").append(id);
123         sb.append("]; prefixCode [").append(prefixCode);
124         sb.append("]");
125         return sb.toString();
126     }
127     
128     @Override JavaDoc
129     public boolean equals(Object JavaDoc o) {
130         if (this == o) {
131             return true;
132         }
133         if (!(o instanceof Space)) {
134             return false;
135         }
136         final Space s = (Space) o;
137         return prefixCode.equals(s.getPrefixCode());
138     }
139     
140     @Override JavaDoc
141     public int hashCode() {
142         return prefixCode.hashCode();
143     }
144     
145 }
146
Popular Tags