1 11 12 package org.eclipse.osgi.framework.internal.core; 13 14 import java.security.Permission ; 15 16 20 21 final class BundleResourcePermission extends Permission { 22 private static final long serialVersionUID = 3256728376969867573L; 23 private long id; 24 25 BundleResourcePermission(long id) { 26 super(String.valueOf(id)); 27 28 this.id = id; 29 } 30 31 BundleResourcePermission(String id) { 32 super(id); 33 34 this.id = Long.parseLong(id); 35 } 36 37 44 45 public boolean implies(Permission p) { 46 if (p instanceof BundleResourcePermission) { 47 BundleResourcePermission target = (BundleResourcePermission) p; 48 49 return this.id == target.id; 50 } 51 52 return false; 53 } 54 55 58 59 public String getActions() { 60 return ""; } 62 63 70 public boolean equals(Object obj) { 71 if (obj == this) { 72 return (true); 73 } 74 75 if (!(obj instanceof BundleResourcePermission)) { 76 return (false); 77 } 78 79 BundleResourcePermission target = (BundleResourcePermission) obj; 80 81 return this.id == target.id; 82 } 83 84 89 90 public int hashCode() { 91 return getName().hashCode(); 92 } 93 } 94 | Popular Tags |