01: /*
02: * Copyright 2006 Luca Garulli (luca.garulli@assetdata.it)
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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 org.romaframework.module.admin.domain;
18:
19: import java.io.Serializable;
20:
21: /**
22: * Represents an Info Category to group Info objects in homogeneous groups.
23: *
24: * @author Luca Garulli (luca.garulli@assetdata.it)
25: *
26: */
27: public class InfoCategory implements Serializable {
28: protected String name;
29:
30: protected String description;
31:
32: public InfoCategory() {
33: }
34:
35: public InfoCategory(String iName) {
36: this (iName, null);
37: }
38:
39: public InfoCategory(String iName, String iDescription) {
40: name = iName;
41: description = iDescription;
42: }
43:
44: @Override
45: public boolean equals(Object obj) {
46: if (!(obj instanceof InfoCategory))
47: return false;
48:
49: InfoCategory other = (InfoCategory) obj;
50: return name.equals(other.name);
51: }
52:
53: @Override
54: public int hashCode() {
55: int hash = 0;
56: if (name != null)
57: hash += name.hashCode();
58: if (description != null)
59: hash += description.hashCode();
60: return hash;
61: }
62:
63: @Override
64: public String toString() {
65: return name;
66: }
67:
68: public String getDescription() {
69: return description;
70: }
71:
72: public void setDescription(String description) {
73: this .description = description;
74: }
75:
76: public String getName() {
77: return name;
78: }
79:
80: public void setName(String name) {
81: this.name = name;
82: }
83: }
|