@Override public String toString() { return "PermissionGroup[" + id() + "]"; }
@Override public int hashCode() { return id().hashCode(); }
private static synchronized void register(PermissionGroup g) { if (!PERMISSIONS.add(g)) { throw new IllegalStateException("attempt to register a second PermissionGroup for " + g.id()); } }
public int compareTo(PermissionGroup that) { // first, sort by the 'compare order' number. This is so that // we can put Hudson.PERMISSIONS first. int r= this.compareOrder()-that.compareOrder(); if(r!=0) return r; // among the permissions of the same group, just sort by their names // so that the sort order is consistent regardless of classloading order. return id().compareTo(that.id()); }