@PublicApi public class JiraServiceContextImpl extends Object implements JiraServiceContext
For now, this guy has to be considered as API because devs must feed a JiraServiceContext instance to Service methods, and this is the only way to create one that will be compatible with mulitple versions of JIRA. If we don't like this, we need to provide a Factory or something.
Constructor and Description |
---|
JiraServiceContextImpl(ApplicationUser user)
Instantiates this class with given user and new empty error collection.
|
JiraServiceContextImpl(ApplicationUser user,
ErrorCollection errorCollection)
Instantiates this class with user and error collection.
|
JiraServiceContextImpl(ApplicationUser user,
ErrorCollection errorCollection,
I18nHelper i18nHelper)
Instantiates this class with user and error collection and I18nHelper.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
ErrorCollection |
getErrorCollection()
Returns error collection, never null
|
I18nHelper |
getI18nBean()
Get an I18nHelper for localising text.
|
ApplicationUser |
getLoggedInApplicationUser()
Returns the User who has invoked the JIRA service method.
|
ApplicationUser |
getLoggedInUser()
Returns the User who has invoked the JIRA service method.
|
int |
hashCode() |
String |
toString()
Prints username and error collection
|
public JiraServiceContextImpl(ApplicationUser user)
user
- userpublic JiraServiceContextImpl(ApplicationUser user, ErrorCollection errorCollection)
user
- usererrorCollection
- error collection; must not be nullIllegalArgumentException
- if error collection is nullpublic JiraServiceContextImpl(ApplicationUser user, ErrorCollection errorCollection, I18nHelper i18nHelper)
user
- usererrorCollection
- error collection; must not be nulli18nHelper
- optional I18nHelper to useIllegalArgumentException
- if error collection is nullpublic ErrorCollection getErrorCollection()
getErrorCollection
in interface JiraServiceContext
public ApplicationUser getLoggedInUser()
JiraServiceContext
getLoggedInUser
in interface JiraServiceContext
public ApplicationUser getLoggedInApplicationUser()
JiraServiceContext
getLoggedInApplicationUser
in interface JiraServiceContext
public I18nHelper getI18nBean()
JiraServiceContext
getI18nBean
in interface JiraServiceContext
Copyright © 2002-2021 Atlassian. All Rights Reserved.