public class

MockApplicationRole

extends Object
implements ApplicationRole
java.lang.Object
   ↳ com.atlassian.jira.application.MockApplicationRole

Summary

Public Constructors
MockApplicationRole()
MockApplicationRole(ApplicationKey key)
MockApplicationRole(ApplicationRole copy)
Public Methods
MockApplicationRole copy()
MockApplicationRole defaultGroupNames(String... names)
MockApplicationRole defaultGroupNames(Iterable<String> names)
MockApplicationRole defaultGroups(Iterable<Group> groups)
MockApplicationRole defaultGroups(Group... group)
MockApplicationRole defined(boolean defined)
boolean equals(Object o)
@Nonnull Set<Group> getDefaultGroups()
Return the default groups configured for the role.
@Nonnull Set<Group> getGroups()
Return the set of groups associated with the role including the default ones.
@Nonnull ApplicationKey getKey()
Returns the canonical ApplicationKey that uniquely identifies this ApplicationRole.
@Nonnull String getName()
Return the name of the ApplicationRole.
int getNumberOfSeats()
Returns the total number of seats of this ApplicationRole issued with the licence.
MockApplicationRole groupNames(String... groups)
MockApplicationRole groupNames(Iterable<String> groups)
MockApplicationRole groups(Group... groups)
MockApplicationRole groups(Iterable<Group> groups)
int hashCode()
boolean isDefined()
Indicates if the Application/Product is defined.
boolean isPlatform()
Returns whether the role is part of the core platform.
boolean isSelectedByDefault()
Determines whether ApplicationRole should be selected by default on user creation
MockApplicationRole key(ApplicationKey key)
MockApplicationRole key(String id)
MockApplicationRole name(String name)
MockApplicationRole numberOfSeats(int numberOfLicenseSeats)
MockApplicationRole selectedByDefault(boolean selectedByDefault)
String toString()
MockApplicationRole unlimitedSeats()
@Nonnull ApplicationRole withGroups(Iterable<Group> groups, Iterable<Group> defaultGroups)
Return a new ApplicationRole with its groups and default groups set to the passed values.
ApplicationRole withSelectedByDefault(boolean selectedByDefault)
Returns a new ApplicationRole with its selected by default settings set to passed value
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.application.ApplicationRole

Public Constructors

public MockApplicationRole ()

public MockApplicationRole (ApplicationKey key)

public MockApplicationRole (ApplicationRole copy)

Public Methods

public MockApplicationRole copy ()

public MockApplicationRole defaultGroupNames (String... names)

public MockApplicationRole defaultGroupNames (Iterable<String> names)

public MockApplicationRole defaultGroups (Iterable<Group> groups)

public MockApplicationRole defaultGroups (Group... group)

public MockApplicationRole defined (boolean defined)

public boolean equals (Object o)

@Nonnull public Set<Group> getDefaultGroups ()

Return the default groups configured for the role.

Returns
  • Set with the default groups associated with the role, set will be empty if there are no default groups.

@Nonnull public Set<Group> getGroups ()

Return the set of groups associated with the role including the default ones.

Returns
  • the groups associated with the role.

@Nonnull public ApplicationKey getKey ()

Returns the canonical ApplicationKey that uniquely identifies this ApplicationRole.

Returns
  • the canonical ApplicationKey that uniquely identifies this ApplicationRole.

@Nonnull public String getName ()

Return the name of the ApplicationRole. The name is i18ned for the calling user if possible.

Returns
  • the name of the ApplicationRole role. The name is i18ned for the calling user if possible.

public int getNumberOfSeats ()

Returns the total number of seats of this ApplicationRole issued with the licence.

Returns
  • the total number of seats of this ApplicationRole issued with the licence.

public MockApplicationRole groupNames (String... groups)

public MockApplicationRole groupNames (Iterable<String> groups)

public MockApplicationRole groups (Group... groups)

public MockApplicationRole groups (Iterable<Group> groups)

public int hashCode ()

public boolean isDefined ()

Indicates if the Application/Product is defined. This is true when the ApplicationRoleDefinition identified by the ApplicationKey is defined. An ApplicationRole is defined when the JIRA plugin that defines it is installed.

Returns
  • true if the ApplicationRole is defined

public boolean isPlatform ()

Returns whether the role is part of the core platform.

Returns
  • true if the application role is part of the core platform, false if it comes from elsewhere such as a plugin.

public boolean isSelectedByDefault ()

Determines whether ApplicationRole should be selected by default on user creation

Returns
  • true when ApplicationRole should be selected by default on user creation

public MockApplicationRole key (ApplicationKey key)

public MockApplicationRole key (String id)

public MockApplicationRole name (String name)

public MockApplicationRole numberOfSeats (int numberOfLicenseSeats)

public MockApplicationRole selectedByDefault (boolean selectedByDefault)

public String toString ()

public MockApplicationRole unlimitedSeats ()

@Nonnull public ApplicationRole withGroups (Iterable<Group> groups, Iterable<Group> defaultGroups)

Return a new ApplicationRole with its groups and default groups set to the passed values.

Parameters
groups the groups associated with the role.
defaultGroups default groups for the role.
Returns
  • a new ApplicationRole with its groups and default groups set to the passed arguments.

public ApplicationRole withSelectedByDefault (boolean selectedByDefault)

Returns a new ApplicationRole with its selected by default settings set to passed value

Parameters
selectedByDefault the new selected by default settings
Returns
  • a new ApplicationRole with its selected by default settings set to passed value