public class MockApplicationProperties extends Object implements ApplicationProperties
| Constructor and Description |
|---|
MockApplicationProperties() |
MockApplicationProperties(Map<String,Object> initialProperties) |
| Modifier and Type | Method and Description |
|---|---|
Map<String,Object> |
asMap()
This will return all application and typed values.
|
String |
getContentType() |
String |
getDefaultBackedString(String name)
Get the property from the application properties, but if not found, try to get from the default properties file.
|
String |
getDefaultBackedText(String name)
Get the property from the application properties, but if not found, try to get from the default properties file.
|
Collection<String> |
getDefaultKeys()
Get all the keys from the default properties
|
Locale |
getDefaultLocale()
Returns the default
Locale set up on the JIRA instance. |
String |
getDefaultString(String name)
Get the default property (if the property is not set)
|
String |
getEncoding()
Returns the encoding to be used by JIRA from the application properties.
|
Collection<String> |
getKeys() |
String |
getMailEncoding()
Convenience method to get the email encoding
|
boolean |
getOption(String key)
Get the option from the application properties, but if not found, try to get from the default properties file.
|
String |
getString(String name)
Returns the value of the given key.
|
Collection<String> |
getStringsWithPrefix(String prefix) |
String |
getText(String name) |
void |
refresh()
Refresh application properties object by refreshing the PropertiesManager
|
MockApplicationProperties |
setDefaultLocale(Locale locale) |
void |
setDefaultString(String name,
String value) |
void |
setEncoding(String encoding) |
void |
setOption(String key,
boolean value)
Sets the boolean application property.
|
void |
setString(String name,
String value)
Sets the string application property.
|
void |
setText(String name,
String value)
Set the text application property.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetJiraBaseUrlpublic String getText(String name)
getText in interface ApplicationPropertiespublic String getDefaultBackedText(String name)
ApplicationPropertiesgetDefaultBackedText in interface ApplicationPropertiespublic void setText(String name, String value)
ApplicationPropertiesStringApplicationPropertySetEvent.setText in interface ApplicationPropertiesname - the key of the application property.value - the value of the application property.public String getString(String name)
ApplicationPropertiesgetString in interface ApplicationPropertiesname - the key to retrievepublic Collection<String> getDefaultKeys()
ApplicationPropertiesgetDefaultKeys in interface ApplicationPropertiespublic String getDefaultBackedString(String name)
ApplicationPropertiesgetDefaultBackedString in interface ApplicationPropertiespublic String getDefaultString(String name)
ApplicationPropertiesgetDefaultString in interface ApplicationPropertiesname - the name of the property.public void setString(String name, String value)
ApplicationPropertiesStringApplicationPropertySetEvent.setString in interface ApplicationPropertiesname - the key of the application property.value - the value of the application property.public boolean getOption(String key)
ApplicationPropertiesgetOption in interface ApplicationPropertiespublic Collection<String> getKeys()
getKeys in interface ApplicationPropertiespublic void setOption(String key, boolean value)
ApplicationPropertiesBooleanApplicationPropertySetEvent.setOption in interface ApplicationPropertieskey - the key of the application property.value - the value of the application property.public String getEncoding()
ApplicationPropertiesgetEncoding in interface ApplicationPropertiespublic String getMailEncoding()
ApplicationPropertiesgetMailEncoding in interface ApplicationPropertiespublic void setEncoding(String encoding)
public String getContentType()
getContentType in interface ApplicationPropertiespublic void refresh()
ApplicationPropertiesrefresh in interface ApplicationPropertiespublic Locale getDefaultLocale()
ApplicationPropertiesLocale set up on the JIRA instance.getDefaultLocale in interface ApplicationPropertiespublic MockApplicationProperties setDefaultLocale(Locale locale)
public Collection<String> getStringsWithPrefix(String prefix)
getStringsWithPrefix in interface ApplicationPropertiespublic Map<String,Object> asMap()
ApplicationPropertiesBoolean object will be returned.
If an application property has a null value, then the key will still be in the Map.keySet()
WARNING: This method is somewhat expensive. Do not use it unless you really
are doing something with all of the application properties, such as for the system information page.
If you are just retrieving a single property, then use one of the get methods instead. For
most properties, ApplicationProperties.getDefaultBackedString(String) or ApplicationProperties.getOption(String) will be the best
choice.
asMap in interface ApplicationPropertiesCopyright © 2002-2022 Atlassian. All Rights Reserved.