1 19 20 package com.sslexplorer.policyframework; 21 22 import java.io.Serializable ; 23 24 25 38 public class AccessRight implements Serializable { 39 40 42 private ResourceType resourceType; 43 private Permission permission; 44 45 51 public AccessRight(ResourceType resourceType, Permission permission) { 52 if (resourceType == null) { 53 throw new IllegalArgumentException ("Null resource type."); 54 } 55 if (permission == null) { 56 throw new IllegalArgumentException ("Null permission."); 57 } 58 this.resourceType = resourceType; 59 this.permission = permission; 60 } 61 62 65 public boolean equals(Object o) { 66 return o instanceof AccessRight ? getPermission().equals( 67 ((AccessRight) o).getPermission()) 68 && getResourceType().equals(((AccessRight) o).getResourceType()) : false; 69 } 70 71 76 public Permission getPermission() { 77 return permission; 78 } 79 80 85 public void setPermission(Permission permission) { 86 this.permission = permission; 87 } 88 89 95 public ResourceType getResourceType() { 96 return resourceType; 97 } 98 99 105 public void setResourceType(ResourceType resourceType) { 106 this.resourceType = resourceType; 107 } 108 } 109 | Popular Tags |