Class Unit
- java.lang.Object
-
- fr.paris.lutece.plugins.unittree.business.unit.Unit
-
- All Implemented Interfaces:
fr.paris.lutece.portal.service.rbac.RBACResource
public class Unit extends java.lang.Object implements fr.paris.lutece.portal.service.rbac.RBACResourceUnit
-
-
Field Summary
Fields Modifier and Type Field Description static intID_NULLstatic intID_ROOTstatic java.lang.StringRESOURCE_TYPE
-
Constructor Summary
Constructors Constructor Description Unit()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAttribute(IUnitAttribute<?> attribute)Add an attributebooleanequals(java.lang.Object obj)<T> IUnitAttribute<T>getAttribute(java.lang.String strKey)Get the attribute from a given keyjava.lang.StringgetCode()Get the codejava.lang.StringgetDescription()Get the descriptionintgetIdParent()Get the id parentintgetIdUnit()Get the id unitjava.lang.StringgetLabel()Get the labeljava.lang.StringgetResourceId()java.lang.StringgetResourceTypeCode()inthashCode()booleanisRoot()Check if the unit is the root unitvoidsetCode(java.lang.String strCode)Set the codevoidsetDescription(java.lang.String strDescription)Set the descriptionvoidsetIdParent(int nIdParent)Set the id parentvoidsetIdUnit(int nIdUnit)Set the id unitvoidsetLabel(java.lang.String strLabel)Set the label
-
-
-
Field Detail
-
RESOURCE_TYPE
public static final java.lang.String RESOURCE_TYPE
- See Also:
- Constant Field Values
-
ID_ROOT
public static final int ID_ROOT
- See Also:
- Constant Field Values
-
ID_NULL
public static final int ID_NULL
- See Also:
- Constant Field Values
-
-
Method Detail
-
getIdUnit
public int getIdUnit()
Get the id unit- Returns:
- the id unit
-
setIdUnit
public void setIdUnit(int nIdUnit)
Set the id unit- Parameters:
nIdUnit- the id unit
-
getCode
public java.lang.String getCode()
Get the code- Returns:
- the code
-
setCode
public void setCode(java.lang.String strCode)
Set the code- Parameters:
strCode- the code
-
getLabel
public java.lang.String getLabel()
Get the label- Returns:
- the label
-
setLabel
public void setLabel(java.lang.String strLabel)
Set the label- Parameters:
strLabel- the label
-
getDescription
public java.lang.String getDescription()
Get the description- Returns:
- the description
-
setDescription
public void setDescription(java.lang.String strDescription)
Set the description- Parameters:
strDescription- the description
-
setIdParent
public void setIdParent(int nIdParent)
Set the id parent- Parameters:
nIdParent- the nIdParent to set
-
getIdParent
public int getIdParent()
Get the id parent- Returns:
- the nIdParent
-
isRoot
public boolean isRoot()
Check if the unit is the root unit- Returns:
- true if the unit is the root unit, false otherwise
-
getAttribute
public <T> IUnitAttribute<T> getAttribute(java.lang.String strKey)
Get the attribute from a given key- Type Parameters:
T- the class of the attribute- Parameters:
strKey- the key of the attribute- Returns:
- the attribute
-
addAttribute
public void addAttribute(IUnitAttribute<?> attribute)
Add an attribute- Parameters:
attribute- the attribute to add
-
getResourceId
public java.lang.String getResourceId()
- Specified by:
getResourceIdin interfacefr.paris.lutece.portal.service.rbac.RBACResource
-
getResourceTypeCode
public java.lang.String getResourceTypeCode()
- Specified by:
getResourceTypeCodein interfacefr.paris.lutece.portal.service.rbac.RBACResource
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-