public final class JiraWebContext extends Object
Context is normally a map but it contains some standard entries which can be easily retrieved using this class.
All getters return empty
if requested object is not set in the context map or has a type different than expected.
Modifier and Type | Method and Description |
---|---|
static JiraWebContext |
from(Map<String,Object> context) |
<T> Optional<T> |
get(String key,
Class<T> type)
Returns value assigned to the specified key provided it is present in the map and has the specified type.
|
Optional<JiraHelper> |
getHelper() |
Optional<I18nHelper> |
getI18n() |
Optional<String> |
getLocation() |
Optional<ApplicationUser> |
getUser()
Tries to figure out the user from context.
|
Optional<String> |
getUsername() |
public static JiraWebContext from(Map<String,Object> context)
public Optional<ApplicationUser> getUser()
ApplicationUser
value then
tries to load the user based on the "username" key in the context.public Optional<JiraHelper> getHelper()
public Optional<I18nHelper> getI18n()
Copyright © 2002-2022 Atlassian. All Rights Reserved.