Class JKPrivilige

java.lang.Object
com.jk.core.security.JKPrivilige

public class JKPrivilige extends Object
This class is used to represents privileges within the framework.
Version:
1.0
Author:
Dr. Jalal H. Kiswani
  • Constructor Details

    • JKPrivilige

      public JKPrivilige()
      This method constructs a new JKPrivilige.
    • JKPrivilige

      public JKPrivilige(int priviligeId, String name, JKPrivilige parent)
      This method constructs a new JKPrivilige 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

      public JKPrivilige(int priviligeId, String name, JKPrivilige parent, int number)
      This method constructs a new JKPrivilige 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

      public JKPrivilige(String name, JKPrivilige parent, int number)
      This method constructs a new JKPrivilige 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

      public boolean equals(Object obj)
      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 return true.
      • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
      • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
      • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
      • For any non-null reference value x, x.equals(null) should return false.

      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.

      Overrides:
      equals in class Object
      Parameters:
      obj - the reference object with which to compare.
      Returns:
      true if this object is the same as the obj argument; false otherwise.
    • getChilds

      public List<JKPrivilige> getChilds()
      This method gets the list of child privileges associated with this privilege.
      Returns:
      the list of child privileges.
    • getDesc

      public String 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

      public JKPrivilige 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

      public String getPriviligeName()
      This method gets the privilege name.
      Returns:
      the privilege name.
    • setChilds

      public void setChilds(List<JKPrivilige> childs)
      This method sets the list of child privileges.
      Parameters:
      childs - Specifies the new list of child privileges.
    • setDesc

      public void setDesc(String desc)
      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

      public void setParentPrivlige(JKPrivilige parentPrivlige)
      This method sets the parent privilege to the specified value.
      Parameters:
      parentPrivlige - Specifies the new parent privilege.
    • setPriviligeId

      public void setPriviligeId(Integer priviligeId)
      This method sets the privilege identifier.
      Parameters:
      priviligeId - Specifies the new privilege identifier.
    • setPriviligeName

      public void setPriviligeName(String priviligeName)
      This method sets the privilege name.
      Parameters:
      priviligeName - Specifies the new privilege name.
    • toString

      public String toString()
      Returns a string representation of the object.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the object.
    • toString

      public String toString(boolean deep)
      This method returns the string representation of the privilege.
      Parameters:
      deep - Indicates deep representation.
      Returns:
      the string representation of the privilege.
    • getFullName

      public String getFullName()
      This method gets the full name of the privilege including its hierarchy.
      Returns:
      the full name of the privilege.