1 28 29 package org.objectweb.util.explorer.core.role.lib; 30 31 import org.objectweb.util.explorer.core.common.lib.DefaultKey; 32 import org.objectweb.util.explorer.core.role.api.Role; 33 34 41 public class DefaultRole 42 implements Role 43 { 44 45 51 52 protected String role_id_; 53 54 55 protected boolean isConcrete_ = true; 56 57 63 67 public DefaultRole(String role_id){ 68 if(role_id==null) 69 role_id = ""; 70 role_id_ = role_id; 71 } 72 73 79 85 88 public String getId() { 89 return role_id_; 90 } 91 92 95 public void setConcrete(boolean isConcrete){ 96 isConcrete_ = isConcrete; 97 } 98 99 102 public boolean isConcrete(){ 103 return isConcrete_; 104 } 105 106 112 116 public boolean equals(Object obj){ 117 if(obj!=null){ 118 return ((DefaultRole)obj).getId().trim().equals(role_id_.trim()); 119 } 120 return false; 121 } 122 123 126 public String toString(){ 127 return "DefaultRole[id=" + this.getId() + "]"; 128 } 129 130 134 public int hashCode(){ 135 return role_id_.hashCode(); 136 } 137 } 138 | Popular Tags |