Removed DOCUMENT ME comments that were generated and applied source code
[utils] / security / src / main / java / org / wamblee / usermgt / Group.java
1 /*
2  * Copyright 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 package org.wamblee.usermgt;
17
18 import org.wamblee.persistence.AbstractPersistent;
19
20 import java.io.Serializable;
21
22 /**
23  * Represents a group.
24  * 
25  * @author Erik Brakkee
26  */
27 public class Group extends AbstractPersistent implements Serializable,
28     Comparable {
29     /**
30      * Group name.
31      */
32     private String name;
33
34     /**
35      * Constructs the group.
36      * 
37      * @param aName
38      */
39     Group(String aName) {
40         super();
41         name = aName;
42     }
43
44     /**
45      * Creates a new Group object.
46      * 
47      */
48     public Group(Group aGroup) {
49         super(aGroup);
50         name = aGroup.name;
51     }
52
53     /**
54      * Creates a new Group object.
55      */
56     protected Group() {
57         super();
58         name = null;
59     }
60
61     /**
62      * Gets the name of the group.
63      * 
64      * @return Group name.
65      */
66     public String getName() {
67         return name;
68     }
69
70     /**
71      * Sets the group name.
72      * 
73      * @param aName
74      *            Group name.
75      */
76     void setName(String aName) {
77         name = aName;
78     }
79
80     /*
81      * (non-Javadoc)
82      * 
83      * @see java.lang.Object#equals(java.lang.Object)
84      */
85     @Override
86     public boolean equals(Object aGroup) {
87         if (!(aGroup instanceof Group)) {
88             return false;
89         }
90
91         return name.equals(((Group) aGroup).name);
92     }
93
94     /*
95      * (non-Javadoc)
96      * 
97      * @see java.lang.Object#hashCode()
98      */
99     @Override
100     public int hashCode() {
101         return name.hashCode();
102     }
103
104     /*
105      * (non-Javadoc)
106      * 
107      * @see java.lang.Comparable#compareTo(T)
108      */
109     public int compareTo(Object aGroup) {
110         return name.compareTo(((Group) aGroup).name);
111     }
112
113     /*
114      * (non-Javadoc)
115      * 
116      * @see java.lang.Object#toString()
117      */
118     @Override
119     public String toString() {
120         return "Group(pk = " + getPrimaryKey() + ", name=" + name + ")";
121     }
122 }