View Javadoc
1   /***************************************************************************
2    * Copyright (C) 2003-2009 eXo Platform SAS.
3    *
4    * This program is free software; you can redistribute it and/or
5    * modify it under the terms of the GNU Affero General Public License
6    * as published by the Free Software Foundation; either version 3
7    * of the License, or (at your option) any later version.
8    *
9    * This program is distributed in the hope that it will be useful,
10   * but WITHOUT ANY WARRANTY; without even the implied warranty of
11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12   * GNU General Public License for more details.
13   *
14   * You should have received a copy of the GNU General Public License
15   * along with this program; if not, see<http://www.gnu.org/licenses/>.
16   *
17   **************************************************************************/
18  package org.exoplatform.ecm.permission;
19  
20  import java.util.Objects;
21  
22  /**
23   * Created by The eXo Platform SARL
24   * Author : Hoang Van Hung hunghvit@gmail.com
25   * Apr 17, 2009
26   */
27  public class PermissionBean {
28  
29    private String  usersOrGroups;
30  
31    private boolean read;
32  
33    private boolean addNode;
34  
35    private boolean setProperty;
36  
37    private boolean remove;
38  
39    public String getUsersOrGroups() {
40      return usersOrGroups;
41    }
42  
43    public void setUsersOrGroups(String s) {
44      usersOrGroups = s;
45    }
46  
47    public boolean isAddNode() {
48      return addNode;
49    }
50  
51    public void setAddNode(boolean b) {
52      addNode = b;
53    }
54  
55    public boolean isRead() {
56      return read;
57    }
58  
59    public void setRead(boolean b) {
60      read = b;
61    }
62  
63    public boolean isRemove() {
64      return remove;
65    }
66  
67    public void setRemove(boolean b) {
68      remove = b;
69    }
70  
71    public boolean isSetProperty() {
72      return setProperty;
73    }
74  
75    public void setSetProperty(boolean b) {
76      setProperty = b;
77    }
78  
79    public boolean equals(Object arg0) {
80      if (arg0 instanceof PermissionBean) {
81        PermissionBean permBean = (PermissionBean) arg0;
82        return this.getUsersOrGroups().equals(permBean.getUsersOrGroups());
83      }
84      return false;
85    }
86  
87    @Override
88    public int hashCode() {
89      return Objects.hash(usersOrGroups);
90    }
91  }