1 12 13 package com.openedit.users; 14 15 20 public class Permission 21 { 22 protected String fieldName; 23 protected String fieldDisplayName; 24 25 public Permission() 26 { 27 } 28 29 public Permission( String inName ) 30 { 31 fieldName = inName; 32 } 33 34 public Permission( String inName, String inDisplayName ) 35 { 36 fieldName = inName; 37 fieldDisplayName = inDisplayName; 38 } 39 40 public String getName() 41 { 42 return fieldName; 43 } 44 45 public String getDisplayName() 46 { 47 return fieldDisplayName; 48 } 49 50 public void setName( String inName ) 51 { 52 fieldName = inName; 53 } 54 55 public void setDisplayName( String inDisplayName ) 56 { 57 fieldDisplayName = inDisplayName; 58 } 59 60 63 public boolean equals( Object o ) 64 { 65 if ( o instanceof Permission ) 66 { 67 Permission p = (Permission) o; 68 if ( fieldName != null ) 69 { 70 return fieldName.equals( p.fieldName ); 71 } 72 else 73 { 74 return ( p.fieldName == null ); 75 } 76 } 77 else 78 { 79 return false; 80 } 81 } 82 83 public int hashCode() 84 { 85 return ( fieldName != null ) ? 86 fieldName.hashCode() : 87 0; 88 } 89 90 public String toString() 91 { 92 return fieldName; 93 } 94 } 95 | Popular Tags |