perssionid.java

来自「Java开发的权限管理的例子」· Java 代码 · 共 69 行

JAVA
69
字号
package org.artemis.right.model;

public class PerssionId  implements java.io.Serializable {


    // Fields    

     private String roleId;
     private String functionId;


    // Constructors

    /** default constructor */
    public PerssionId() {
    }

    
    /** full constructor */
    public PerssionId(String roleId, String functionId) {
        this.roleId = roleId;
        this.functionId = functionId;
    }

   
    // Property accessors

    public String getRoleId() {
        return this.roleId;
    }
    
    public void setRoleId(String roleId) {
        this.roleId = roleId;
    }

    public String getFunctionId() {
        return this.functionId;
    }
    
    public void setFunctionId(String functionId) {
        this.functionId = functionId;
    }
   



   public boolean equals(Object other) {
         if ( (this == other ) ) return true;
		 if ( (other == null ) ) return false;
		 if ( !(other instanceof PerssionId) ) return false;
		 PerssionId castOther = ( PerssionId ) other; 
         
		 return ( (this.getRoleId()==castOther.getRoleId()) || ( this.getRoleId()!=null && castOther.getRoleId()!=null && this.getRoleId().equals(castOther.getRoleId()) ) )
 && ( (this.getFunctionId()==castOther.getFunctionId()) || ( this.getFunctionId()!=null && castOther.getFunctionId()!=null && this.getFunctionId().equals(castOther.getFunctionId()) ) );
   }
   
   public int hashCode() {
         int result = 17;
         
         result = 37 * result + ( getRoleId() == null ? 0 : this.getRoleId().hashCode() );
         result = 37 * result + ( getFunctionId() == null ? 0 : this.getFunctionId().hashCode() );
         return result;
   }   





}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?