Class CMARole


  • public class CMARole
    extends CMAResource
    Model representing a role in Contentful.
    • Constructor Detail

      • CMARole

        public CMARole()
        Creates a new role.
    • 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:
        setId in class CMAResource
        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:
        setVersion in class CMAResource
        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:
        setSpaceId in class CMAResource
        Parameters:
        id - the id to be set.
        Returns:
        this space instance for chaining.
        See Also:
        setId(String)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class CMAResource
        Returns:
        a human readable string, representing the object.