KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > dotmarketing > beans > Permission


1 package com.dotmarketing.beans;
2
3 import java.io.Serializable JavaDoc;
4
5 import org.apache.commons.lang.builder.ToStringBuilder;
6
7 /** @author Hibernate CodeGenerator */
8 public class Permission implements Serializable JavaDoc {
9
10     private static final long serialVersionUID = 1L;
11
12     /** persistent field */
13     private long id;
14
15     /** persistent field */
16     private long inode;
17
18     /** persistent field */
19     private long roleId;
20
21     /** persistent field */
22     private int permission;
23
24     /** full constructor */
25     public Permission(long inode, long roleid, int permission) {
26         this.inode = inode;
27         this.roleId = roleid;
28         this.permission = permission;
29     }
30
31     /** default constructor */
32     public Permission() {
33     }
34
35     public long getInode() {
36         return this.inode;
37     }
38
39     public void setInode(long inode) {
40         this.inode = inode;
41     }
42
43     public long getRoleId() {
44         return this.roleId;
45     }
46
47     public void setRoleId(long roleid) {
48         this.roleId = roleid;
49     }
50
51     public int getPermission() {
52         return this.permission;
53     }
54
55     public void setPermission(int permission) {
56         this.permission = permission;
57     }
58
59     public String JavaDoc toString() {
60         return ToStringBuilder.reflectionToString(this);
61     }
62
63     /**
64      * Returns the id.
65      * @return long
66      */

67     public long getId() {
68         return id;
69     }
70
71     /**
72      * Sets the id.
73      * @param id The id to set
74      */

75     public void setId(long id) {
76         this.id = id;
77     }
78     
79     @Override JavaDoc
80     public boolean equals(Object JavaDoc other) {
81
82         if (!(other instanceof Permission)) {
83             return false;
84         }
85
86         Permission castOther = ( Permission ) other;
87
88         return ((this.getInode() == castOther.getInode())
89                 && (this.getRoleId() == castOther.getRoleId())
90                 && (this.getPermission() == castOther.getPermission()));
91     }
92
93     @Override JavaDoc
94     public int hashCode() {
95         return (int)(this.getInode() + this.getRoleId() + this.getPermission());
96     }
97     
98     
99
100 }
101
Popular Tags