public abstract class KeyPermission extends Object implements Comparable<KeyPermission>
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
.
Modifier and Type | Field and Description |
---|---|
(package private) int |
keyId |
(package private) int |
permission |
Constructor and Description |
---|
KeyPermission()
Create a new
KeyPermission object. |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(KeyPermission other)
Compare the keyId of this object to the keyId of
another
KeyPermission 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.
|
public final int getKeyId()
public final void setKeyId(int keyId)
public final int getPermission()
public final void setPermission(int permission)
public final int compareTo(KeyPermission other)
KeyPermission
object.compareTo
in interface Comparable<KeyPermission>