Package com.jk.core.security
Class JKPrivilige
java.lang.Object
com.jk.core.security.JKPrivilige
This class is used to represents privileges within the framework.
- Version:
- 1.0
- Author:
- Dr. Jalal H. Kiswani
-
Constructor Summary
ConstructorsConstructorDescriptionThis method constructs a newJKPrivilige
.JKPrivilige
(int priviligeId, String name, JKPrivilige parent) This method constructs a newJKPrivilige
with a given identifier (ID), name, and parent privilege.JKPrivilige
(int priviligeId, String name, JKPrivilige parent, int number) This method constructs a newJKPrivilige
with a given identifier (ID), name, parent privilege and number.JKPrivilige
(String name, JKPrivilige parent, int number) This method constructs a newJKPrivilige
with a given name, parent privilege and number. -
Method Summary
Modifier and TypeMethodDescriptionprotected int
This method calculate this privilege identifier (ID).boolean
Indicates whether some other object is "equal to" this one.This method gets the list of child privileges associated with this privilege.getDesc()
This method gets the description of the privilege.This method gets the full name of the privilege including its hierarchy.int
This method gets the number associated with the privilege.This method gets the parent privilege.int
This method gets the privilege identifier (ID).This method gets the privilege name.void
setChilds
(List<JKPrivilige> childs) This method sets the list of child privileges.void
This method sets the description to the specified value.void
setNumber
(int number) This method sets the number associated with the privilege to the specified value.void
setParentPrivlige
(JKPrivilige parentPrivlige) This method sets the parent privilege to the specified value.void
setPriviligeId
(Integer priviligeId) This method sets the privilege identifier.void
setPriviligeName
(String priviligeName) This method sets the privilege name.toString()
Returns a string representation of the object.toString
(boolean deep) This method returns the string representation of the privilege.
-
Constructor Details
-
JKPrivilige
public JKPrivilige()This method constructs a newJKPrivilige
. -
JKPrivilige
This method constructs a newJKPrivilige
with a given identifier (ID), name, and parent privilege.- Parameters:
priviligeId
- Specifies the identifier of the privilege.name
- Specifies the name of the privilege.parent
- Specifies the parent privilege.
-
JKPrivilige
This method constructs a newJKPrivilige
with a given identifier (ID), name, parent privilege and number.- Parameters:
priviligeId
- Specifies the identifier of the privilege.name
- Specifies the name of the privilege.parent
- Specifies the parent privilege.number
- Specifies the number associated with the privilege.
-
JKPrivilige
This method constructs a newJKPrivilige
with a given name, parent privilege and number.- Parameters:
name
- Specifies the name of the privilege.parent
- Specifies the parent privilege.number
- Specifies the number associated with the privilege.
-
-
Method Details
-
equals
Indicates whether some other object is "equal to" this one.The
equals
method implements an equivalence relation on non-null object references:- It is reflexive: for any non-null reference value
x
,x.equals(x)
should returntrue
. - It is symmetric: for any non-null reference values
x
andy
,x.equals(y)
should returntrue
if and only ify.equals(x)
returnstrue
. - It is transitive: for any non-null reference values
x
,y
, andz
, ifx.equals(y)
returnstrue
andy.equals(z)
returnstrue
, thenx.equals(z)
should returntrue
. - It is consistent: for any non-null reference values
x
andy
, multiple invocations ofx.equals(y)
consistently returntrue
or consistently returnfalse
, provided no information used inequals
comparisons on the objects is modified. - For any non-null reference value
x
,x.equals(null)
should returnfalse
.
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
- It is reflexive: for any non-null reference value
-
getChilds
This method gets the list of child privileges associated with this privilege.- Returns:
- the list of child privileges.
-
getDesc
This method gets the description of the privilege.- Returns:
- the description of the privilege.
-
getNumber
public int getNumber()This method gets the number associated with the privilege.- Returns:
- the number associated with the privilege.
-
getParentPrivlige
This method gets the parent privilege.- Returns:
- the parent privilege.
-
getPriviligeId
public int getPriviligeId()This method gets the privilege identifier (ID).- Returns:
- the privilege identifier (ID).
-
calculatePriviligeId
protected int calculatePriviligeId()This method calculate this privilege identifier (ID).- Returns:
- the privilege identifier (ID).
-
getPriviligeName
This method gets the privilege name.- Returns:
- the privilege name.
-
setChilds
This method sets the list of child privileges.- Parameters:
childs
- Specifies the new list of child privileges.
-
setDesc
This method sets the description to the specified value.- Parameters:
desc
- Specifies the new description.
-
setNumber
public void setNumber(int number) This method sets the number associated with the privilege to the specified value.- Parameters:
number
- Specifies the new number associated with the privilege.
-
setParentPrivlige
This method sets the parent privilege to the specified value.- Parameters:
parentPrivlige
- Specifies the new parent privilege.
-
setPriviligeId
This method sets the privilege identifier.- Parameters:
priviligeId
- Specifies the new privilege identifier.
-
setPriviligeName
This method sets the privilege name.- Parameters:
priviligeName
- Specifies the new privilege name.
-
toString
Returns a string representation of the object. -
toString
This method returns the string representation of the privilege.- Parameters:
deep
- Indicates deep representation.- Returns:
- the string representation of the privilege.
-
getFullName
This method gets the full name of the privilege including its hierarchy.- Returns:
- the full name of the privilege.
-