1 package com.dotmarketing.beans; 2 3 import java.io.Serializable ; 4 5 import org.apache.commons.lang.builder.ToStringBuilder; 6 7 8 public class Permission implements Serializable { 9 10 private static final long serialVersionUID = 1L; 11 12 13 private long id; 14 15 16 private long inode; 17 18 19 private long roleId; 20 21 22 private int permission; 23 24 25 public Permission(long inode, long roleid, int permission) { 26 this.inode = inode; 27 this.roleId = roleid; 28 this.permission = permission; 29 } 30 31 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 toString() { 60 return ToStringBuilder.reflectionToString(this); 61 } 62 63 67 public long getId() { 68 return id; 69 } 70 71 75 public void setId(long id) { 76 this.id = id; 77 } 78 79 @Override 80 public boolean equals(Object 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 94 public int hashCode() { 95 return (int)(this.getInode() + this.getRoleId() + this.getPermission()); 96 } 97 98 99 100 } 101 | Popular Tags |