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
Class for holding a keyId and a permission value.
It implements the
Comparable
interface to
be able to sort a List
by the keyId value.
Note! The compareTo
method of this class
is not consistent with the equals
method of
any of the subclasses. Ie. the compareTo
method may return 0, while the equals
method returns FALSE. This is because we need to compare
subclasses to each other while sorting a List
.
- Version:
- 2.0
- Author:
- Nicklas
- Last modified
- $Date: 2012-09-14 09:28:35 +0200 (fr, 14 sep 2012) $
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal int
compareTo
(KeyPermission other) Compare the keyId of this object to the keyId of anotherKeyPermission
object.final int
getKeyId()
Get the id of the key.final int
Get the permission.final void
setKeyId
(int keyId) Set the id of the key.final void
setPermission
(int permission) Set the permission.
-
Field Details
-
keyId
int keyId -
permission
int permission
-
-
Constructor Details
-
KeyPermission
public KeyPermission()Create a newKeyPermission
object.
-
-
Method Details
-
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
Compare the keyId of this object to the keyId of anotherKeyPermission
object.- Specified by:
compareTo
in interfaceComparable<KeyPermission>
-