Package com.atlassian.jira.application
Class MockApplicationRole
java.lang.Object
com.atlassian.jira.application.MockApplicationRole
- All Implemented Interfaces:
ApplicationRole
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()
defaultGroupNames
(Iterable<String> names) defaultGroupNames
(String... names) defaultGroups
(com.atlassian.crowd.embedded.api.Group... group) defaultGroups
(Iterable<com.atlassian.crowd.embedded.api.Group> groups) defined
(boolean defined) boolean
Set
<com.atlassian.crowd.embedded.api.Group> Return the default groups configured for the role.Set
<com.atlassian.crowd.embedded.api.Group> Return the set of groups associated with the role including the default ones.com.atlassian.application.api.ApplicationKey
getKey()
Returns the canonicalApplicationKey
that uniquely identifies thisApplicationRole
.getName()
Return the name of theApplicationRole
.int
Returns the total number of seats of thisApplicationRole
issued with the licence.groupNames
(Iterable<String> groups) groupNames
(String... groups) groups
(com.atlassian.crowd.embedded.api.Group... groups) int
hashCode()
boolean
Indicates if the Application/Product is defined.boolean
Returns whether the role is part of the core platform.boolean
Determines whetherApplicationRole
should be selected by default on user creationkey
(com.atlassian.application.api.ApplicationKey key) numberOfSeats
(int numberOfLicenseSeats) selectedByDefault
(boolean selectedByDefault) toString()
withGroups
(Iterable<com.atlassian.crowd.embedded.api.Group> groups, Iterable<com.atlassian.crowd.embedded.api.Group> defaultGroups) Return a newApplicationRole
with its groups and default groups set to the passed values.withSelectedByDefault
(boolean selectedByDefault) Returns a newApplicationRole
with its selected by default settings set to passed value
-
Constructor Details
-
MockApplicationRole
public MockApplicationRole() -
MockApplicationRole
public MockApplicationRole(com.atlassian.application.api.ApplicationKey key) -
MockApplicationRole
-
-
Method Details
-
key
-
key
-
name
-
groups
-
groupNames
-
groups
-
groupNames
-
defaultGroups
-
defaultGroupNames
-
defaultGroups
-
defaultGroupNames
-
numberOfSeats
-
selectedByDefault
-
defined
-
unlimitedSeats
-
getKey
@Nonnull public com.atlassian.application.api.ApplicationKey getKey()Description copied from interface:ApplicationRole
Returns the canonicalApplicationKey
that uniquely identifies thisApplicationRole
.- Specified by:
getKey
in interfaceApplicationRole
- Returns:
- the canonical
ApplicationKey
that uniquely identifies thisApplicationRole
.
-
getName
Description copied from interface:ApplicationRole
Return the name of theApplicationRole
. The name is i18ned for the calling user if possible.- Specified by:
getName
in interfaceApplicationRole
- Returns:
- the name of the
ApplicationRole
role. The name is i18ned for the calling user if possible.
-
getGroups
Description copied from interface:ApplicationRole
Return the set of groups associated with the role including the default ones.- Specified by:
getGroups
in interfaceApplicationRole
- Returns:
- the groups associated with the role.
-
getDefaultGroups
Description copied from interface:ApplicationRole
Return the default groups configured for the role.- Specified by:
getDefaultGroups
in interfaceApplicationRole
- Returns:
- Set with the default groups associated with the role, set will be empty if there are no default groups.
-
withGroups
@Nonnull public ApplicationRole withGroups(@Nonnull Iterable<com.atlassian.crowd.embedded.api.Group> groups, @Nonnull Iterable<com.atlassian.crowd.embedded.api.Group> defaultGroups) Description copied from interface:ApplicationRole
Return a newApplicationRole
with its groups and default groups set to the passed values.- Specified by:
withGroups
in interfaceApplicationRole
- 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.
-
getNumberOfSeats
public int getNumberOfSeats()Description copied from interface:ApplicationRole
Returns the total number of seats of thisApplicationRole
issued with the licence.- Specified by:
getNumberOfSeats
in interfaceApplicationRole
- Returns:
- the total number of seats of this
ApplicationRole
issued with the licence.
-
isSelectedByDefault
public boolean isSelectedByDefault()Description copied from interface:ApplicationRole
Determines whetherApplicationRole
should be selected by default on user creation- Specified by:
isSelectedByDefault
in interfaceApplicationRole
- Returns:
true
whenApplicationRole
should be selected by default on user creation
-
isDefined
public boolean isDefined()Description copied from interface:ApplicationRole
Indicates if the Application/Product is defined. This is true when theApplicationRoleDefinition
identified by theApplicationKey
is defined. AnApplicationRole
is defined when the JIRA plugin that defines it is installed.- Specified by:
isDefined
in interfaceApplicationRole
- Returns:
true
if theApplicationRole
is defined
-
isPlatform
public boolean isPlatform()Description copied from interface:ApplicationRole
Returns whether the role is part of the core platform.- Specified by:
isPlatform
in interfaceApplicationRole
- Returns:
- true if the application role is part of the core platform, false if it comes from elsewhere such as a plugin.
-
withSelectedByDefault
Description copied from interface:ApplicationRole
Returns a newApplicationRole
with its selected by default settings set to passed value- Specified by:
withSelectedByDefault
in interfaceApplicationRole
- Parameters:
selectedByDefault
- the new selected by default settings- Returns:
- a new
ApplicationRole
with its selected by default settings set to passed value
-
copy
-
equals
-
hashCode
public int hashCode() -
toString
-