Class MockRoleActor

java.lang.Object
com.atlassian.jira.security.roles.MockRoleActor
All Implemented Interfaces:
ProjectRoleActor, RoleActor
Direct Known Subclasses:
MockGroupRoleActor, MockUserRoleActor

public class MockRoleActor extends Object implements ProjectRoleActor
  • Constructor Details

    • MockRoleActor

      public MockRoleActor(String descriptor, String parameter)
    • MockRoleActor

      public MockRoleActor(Long projectRoleId, Long projectId, String descriptor, String parameter, String type)
    • MockRoleActor

      public MockRoleActor(Long projectRoleId, Long projectId, String parameter, String type)
  • Method Details

    • getDescriptor

      public String getDescriptor()
      Description copied from interface: RoleActor
      Returns a pretty viewable representation of the contents of the RoleActor (e.g. if a UserRoleActor, then their full name, James Brown, if a GroupRoleActor, then the name of the group, Business Analysts). NOTE that the returned value is used in RoleActorComparator for sorting.
      Specified by:
      getDescriptor in interface RoleActor
      Returns:
      pretty descriptor
    • getPrettyName

      public String getPrettyName()
    • getType

      public String getType()
      Description copied from interface: RoleActor
      Returns a string that identifies the implementation type. This allows us to group common types.
      Specified by:
      getType in interface RoleActor
      Returns:
      implementation type
    • getUsers

      public Set<ApplicationUser> getUsers()
      Description copied from interface: RoleActor
      Will provide a Set of users encapsulated by this RoleActor.

      Specified by:
      getUsers in interface RoleActor
      Returns:
      a Set of users encapsulated by this RoleActor.
    • contains

      public boolean contains(ApplicationUser user)
      Description copied from interface: RoleActor
      Does this RoleActor contain the specified user.
      Specified by:
      contains in interface RoleActor
      Parameters:
      user - the user to check if they are contained
      Returns:
      true if the user is matched by this RoleActor
    • isActive

      public boolean isActive()
      Description copied from interface: RoleActor
      Whether this Role Actor entity is active or not;
      Specified by:
      isActive in interface RoleActor
    • getProjectId

      public Long getProjectId()
      Description copied from interface: ProjectRoleActor
      Gets the project this is associated with.
      Specified by:
      getProjectId in interface ProjectRoleActor
      Returns:
      project associated with
    • getProjectRoleId

      public Long getProjectRoleId()
      Description copied from interface: RoleActor
      This will get the ProjectRole that this RoleActor belongs to.
      Specified by:
      getProjectRoleId in interface RoleActor
      Returns:
      the project role that this instance belongs to.
    • getId

      public Long getId()
      Description copied from interface: RoleActor
      Returns the id for the Role Actor
      Specified by:
      getId in interface RoleActor
      Returns:
      the id for the Role Actor
    • getParameter

      public String getParameter()
      Description copied from interface: RoleActor
      Returns the string that identifies the target of this role actor (ex. if you are a group role actor, then this will be the unique identifier of the group, the group name).
      Specified by:
      getParameter in interface RoleActor
      Returns:
      the target of the role actor
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object