Package com.contentful.java.cma.model
Class CMARole
- java.lang.Object
-
- com.contentful.java.cma.model.CMAResource
-
- com.contentful.java.cma.model.CMARole
-
public class CMARole extends CMAResource
Model representing a role in Contentful.
-
-
Constructor Summary
Constructors Constructor Description CMARole()Creates a new role.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CMARoleaddPolicy(CMAPolicy policy)Add a new policy to the existing ones, creating a new list if needed.java.lang.StringgetDescription()Description of this role, human readable.java.lang.StringgetName()What is the name of this role?CMAPermissionsgetPermissions()java.util.List<CMAPolicy>getPolicies()CMARolesetDescription(java.lang.String description)Update or set the description of this role.CMARolesetId(java.lang.String id)Sets the id of this space membership.CMARolesetName(java.lang.String name)Update the name of the role.CMARolesetPermissions(CMAPermissions permissions)Replace the currently set permissions with a new one.voidsetPolicies(java.util.List<CMAPolicy> policies)Update the complete list of policies.CMARolesetSpaceId(java.lang.String id)Sets the id of this space memberships space.CMARolesetVersion(java.lang.Integer version)Set the version of this space membership.java.lang.StringtoString()-
Methods inherited from class com.contentful.java.cma.model.CMAResource
getEnvironmentId, getId, getSpaceId, getSystem, getVersion, getVisibility, isArchived, isPublished, setEnvironmentId, setSystem, setVisibility
-
-
-
-
Method Detail
-
getName
public java.lang.String getName()
What is the name of this role?- Returns:
- the name of this role.
-
setName
public CMARole setName(java.lang.String name)
Update the name of the role.- Parameters:
name- human readable string representing the name.- Returns:
- this instance for chaining.
-
getDescription
public java.lang.String getDescription()
Description of this role, human readable.- Returns:
- a string describing this role.
-
setDescription
public CMARole setDescription(java.lang.String description)
Update or set the description of this role.- Parameters:
description- a non null string representing the description- Returns:
- this instance for ease of chaining.
-
getPolicies
public java.util.List<CMAPolicy> getPolicies()
- Returns:
- a list of policies this role contains.
-
setPolicies
public void setPolicies(java.util.List<CMAPolicy> policies)
Update the complete list of policies.- Parameters:
policies- the new policies to be used.
-
addPolicy
public CMARole addPolicy(CMAPolicy policy)
Add a new policy to the existing ones, creating a new list if needed.- Parameters:
policy- the policy to be added.- Returns:
- this instance for chaining.
-
getPermissions
public CMAPermissions getPermissions()
- Returns:
- the permissions set.
-
setPermissions
public CMARole setPermissions(CMAPermissions permissions)
Replace the currently set permissions with a new one.- Parameters:
permissions- new permissions to be set- Returns:
- this instance for chaining.
-
setId
public CMARole setId(java.lang.String id)
Sets the id of this space membership.- Overrides:
setIdin classCMAResource- Parameters:
id- to be set.- Returns:
- this instance for chaining.
-
setVersion
public CMARole setVersion(java.lang.Integer version)
Set the version of this space membership.- Overrides:
setVersionin classCMAResource- Parameters:
version- the version to be set.- Returns:
- this space instance for chaining.
-
setSpaceId
public CMARole setSpaceId(java.lang.String id)
Sets the id of this space memberships space.- Overrides:
setSpaceIdin classCMAResource- Parameters:
id- the id to be set.- Returns:
- this space instance for chaining.
- See Also:
setId(String)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classCMAResource- Returns:
- a human readable string, representing the object.
-
-