Package com.inesm.KeyManager.model
Class Role
java.lang.Object
com.inesm.KeyManager.model.Role
- All Implemented Interfaces:
Resource,Serializable
Represents a container for a set of permissions.
Used to enforce authorization for operations.
All the getters and setters are the default ones.
Details about the meaning of each field are provided in the source code.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeserialize(String data) Deserializes the resource from a data string generated by theResource.serialize()method.getColor()getName()Gets the station resource identifier.longvoidUpdates the fields in the current object instance with the ones from another object.Serializes a resource into a string.voidvoidsetDescription(String description) voidvoidsetPermissions(List<Operation> permissions) voidsetRoleID(long roleID) toString()
-
Field Details
-
UNDEFINED
public static final long UNDEFINED- See Also:
-
-
Constructor Details
-
Role
public Role()
-
-
Method Details
-
toString
-
patch
Updates the fields in the current object instance with the ones from another object. Will only update the fields that have been modified after the initialization.- Parameters:
upd- the object containing the fields to update the current instance with
-
getResourceID
Description copied from interface:ResourceGets the station resource identifier.- Specified by:
getResourceIDin interfaceResource- Returns:
- a string containing the resource identifier.
-
serialize
Description copied from interface:ResourceSerializes a resource into a string.- Specified by:
serializein interfaceResource- Returns:
- the string representing the serialization of the resource.
- Throws:
IOException- if an error occurred during serialization
-
deserialize
Description copied from interface:ResourceDeserializes the resource from a data string generated by theResource.serialize()method.- Specified by:
deserializein interfaceResource- Parameters:
data- the serialized data as a string- Throws:
IOException- if an error occurred during the serialization processClassNotFoundException- if its was not possible to load the class data, or the class data was not found
-
getColor
-
setColor
-
getRoleID
public long getRoleID() -
setRoleID
public void setRoleID(long roleID) -
getName
-
setName
-
getDescription
-
setDescription
-
getPermissions
-
setPermissions
-