1 17 package org.alfresco.repo.security.permissions.impl; 18 19 import org.alfresco.repo.security.permissions.PermissionEntry; 20 import org.alfresco.util.EqualsHelper; 21 22 27 public abstract class AbstractPermissionEntry implements PermissionEntry 28 { 29 30 public AbstractPermissionEntry() 31 { 32 super(); 33 } 34 35 @Override 36 public boolean equals(Object o) 37 { 38 if (this == o) 39 { 40 return true; 41 } 42 if (!(o instanceof AbstractPermissionEntry)) 43 { 44 return false; 45 } 46 AbstractPermissionEntry other = (AbstractPermissionEntry) o; 47 return EqualsHelper.nullSafeEquals(this.getNodeRef(), 48 other.getNodeRef()) 49 && EqualsHelper.nullSafeEquals(this.getPermissionReference(), 50 other.getPermissionReference()) 51 && EqualsHelper.nullSafeEquals(this.getAuthority(), other.getAuthority()) 52 && EqualsHelper.nullSafeEquals(this.getAccessStatus(), other.getAccessStatus()); 53 } 54 55 @Override 56 public int hashCode() 57 { 58 int hashCode = getNodeRef().hashCode(); 59 if (getPermissionReference() != null) 60 { 61 hashCode = hashCode * 37 + getPermissionReference().hashCode(); 62 } 63 if (getAuthority() != null) 64 { 65 hashCode = hashCode * 37 + getAuthority().hashCode(); 66 } 67 if(getAccessStatus() != null) 68 { 69 hashCode = hashCode * 37 + getAccessStatus().hashCode(); 70 } 71 return hashCode; 72 } 73 74 75 76 } 77 | Popular Tags |