* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.wamblee.usermgt;
import java.util.ArrayList;
* @author Erik Brakkee
*/
public class InMemoryGroupSet implements GroupSet {
-
+
private AtomicLong pk = new AtomicLong(1l);
-
+
/**
* Groups.
*/
* org.wamblee.usermgt.GroupSet#groupModified(org.wamblee.usermgt.Group)
*/
public void groupModified(Group aGroup) {
- for (int i = 0; i < groups.size(); i++) {
- if (groups.get(i).getPrimaryKey().equals(aGroup.getPrimaryKey())) {
+ for (int i = 0; i < groups.size(); i++) {
+ if (groups.get(i).getPrimaryKey().equals(aGroup.getPrimaryKey())) {
groups.remove(i);
groups.add(aGroup);
return;
*/
public boolean add(Group aGroup) {
aGroup.setPrimaryKey(pk.getAndIncrement());
- if ( find(aGroup.getName()) != null ) {
- return false;
+ if (find(aGroup.getName()) != null) {
+ return false;
}
return groups.add(aGroup);
}