Package net.sf.basedb.core.data.keyring
Class KeyPermission
- java.lang.Object
-
- net.sf.basedb.core.data.keyring.KeyPermission
-
- All Implemented Interfaces:
Comparable<KeyPermission>
- Direct Known Subclasses:
GroupKeys
,ProjectKeys
,RoleKeys
,UserKeys
public abstract class KeyPermission extends Object implements Comparable<KeyPermission>
Class for holding a keyId and a permission value. It implements theComparable
interface to be able to sort aList
by the keyId value.Note! The
compareTo
method of this class is not consistent with theequals
method of any of the subclasses. Ie. thecompareTo
method may return 0, while theequals
method returns FALSE. This is because we need to compare subclasses to each other while sorting aList
.- Version:
- 2.0
- Author:
- Nicklas
- Last modified
- $Date: 2012-09-14 09:28:35 +0200 (fr, 14 sep 2012) $
-
-
Field Summary
Fields Modifier and Type Field Description (package private) int
keyId
(package private) int
permission
-
Constructor Summary
Constructors Constructor Description KeyPermission()
Create a newKeyPermission
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(KeyPermission other)
Compare the keyId of this object to the keyId of anotherKeyPermission
object.int
getKeyId()
Get the id of the key.int
getPermission()
Get the permission.void
setKeyId(int keyId)
Set the id of the key.void
setPermission(int permission)
Set the permission.
-
-
-
Method Detail
-
getKeyId
public final int getKeyId()
Get the id of the key.
-
setKeyId
public final void setKeyId(int keyId)
Set the id of the key.
-
getPermission
public final int getPermission()
Get the permission.
-
setPermission
public final void setPermission(int permission)
Set the permission.
-
compareTo
public final int compareTo(KeyPermission other)
Compare the keyId of this object to the keyId of anotherKeyPermission
object.- Specified by:
compareTo
in interfaceComparable<KeyPermission>
-
-