- All Implemented Interfaces:
- Serializable, Comparator<Permission>
public class PermissionComparator
extends Object
implements Comparator<Permission>, Serializable
A Comparator for Permission that avoids using equals and hashCode() on
Permission implementations.
This comparator orders the Permission first by Class, then Name, followed
by Actions.
Class is sorted by class hashcode.
Name is sorted using Unicode character order, so wildcards "*" will
preceed numbers, which will preceed letters.
UnresolvedPermission is a special case.
The comparator must be as fast as possible, the common case is not equal,
so that must be very fast.
Note that for SocketPermissionCollection that the desired order to add to
SocketPermission's is with the most likely permissions added last.
HINT: Use a NavigableMap to return a reverse order iterator for
PermissionCollection's like SocketPermissionCollection and
FilePermissionCollection.
- Since:
- 3.0.0
- Author:
- Peter Firmstone.
- See Also:
- Serialized Form