public class MockOptionsManager extends Object implements OptionsManager
Constructor and Description |
---|
MockOptionsManager() |
Modifier and Type | Method and Description |
---|---|
Option |
createOption(FieldConfig fieldConfig,
Long parentOptionId,
Long sequence,
String value)
Create a new option for the given custom field config.
|
List<Option> |
createOptions(FieldConfig config,
Long parentOptionId,
Long sequence,
Iterable<String> options)
Bulk version of
OptionsManager.createOption(FieldConfig, Long, Long, String) method |
void |
deleteOptionAndChildren(Option option) |
void |
disableOption(Option option)
Set an option to disabled.
|
void |
enableOption(Option option)
Set an option to enabled.
|
Option |
findByOptionId(Long optionId) |
List<Option> |
findByOptionValue(String value)
Finds all options with the given value.
|
List<Option> |
findByParentId(Long parentOptionId)
Finds all options with the given parent option id.
|
List<Option> |
getAllOptions()
Retreives all
Option in the system. |
List<Option> |
getOptions(CustomField field,
Collection<Long> projectIds,
Collection<String> issueTypeIds)
Returns all options in the context of given projects and issue types for the custom field.
|
Options |
getOptions(FieldConfig fieldConfig)
Get options for this particular custom field type.
|
static List<String> |
optionsToPaths(Iterable<? extends Option> options) |
void |
removeCustomFieldConfigOptions(FieldConfig fieldConfig) |
void |
removeCustomFieldOptions(CustomField customField) |
void |
setRootOptions(FieldConfig fieldConfig,
Options options) |
void |
setValue(Option option,
String value) |
void |
store(Option option) |
void |
updateOptions(Collection<Option> options)
Update a set of options.
|
public Options getOptions(FieldConfig fieldConfig)
OptionsManager
getOptions
in interface OptionsManager
fieldConfig
- For example, retrieved from CustomField.getRelevantConfig(com.atlassian.jira.issue.Issue)
public void setRootOptions(FieldConfig fieldConfig, Options options)
setRootOptions
in interface OptionsManager
public void removeCustomFieldOptions(CustomField customField)
removeCustomFieldOptions
in interface OptionsManager
public void removeCustomFieldConfigOptions(FieldConfig fieldConfig)
removeCustomFieldConfigOptions
in interface OptionsManager
public void updateOptions(Collection<Option> options)
OptionsManager
Options
objects may be stale, and should be
re-fetched with OptionsManager.getOptions(com.atlassian.jira.issue.fields.config.FieldConfig)
.updateOptions
in interface OptionsManager
options
- Usually an Options
implementation.public Option createOption(FieldConfig fieldConfig, Long parentOptionId, Long sequence, String value)
OptionsManager
createOption
in interface OptionsManager
fieldConfig
- The custom field config to create the option forparentOptionId
- The id of the parent option, or null if this is a root optionsequence
- The sequence of the option (position on the list)value
- The value of the optionpublic List<Option> createOptions(FieldConfig config, Long parentOptionId, Long sequence, Iterable<String> options)
OptionsManager
OptionsManager.createOption(FieldConfig, Long, Long, String)
methodcreateOptions
in interface OptionsManager
public void deleteOptionAndChildren(Option option)
deleteOptionAndChildren
in interface OptionsManager
public Option findByOptionId(Long optionId)
findByOptionId
in interface OptionsManager
public List<Option> getAllOptions()
OptionsManager
Option
in the system.getAllOptions
in interface OptionsManager
public void enableOption(Option option)
OptionsManager
enableOption
in interface OptionsManager
option
- The Option to enable.public void disableOption(Option option)
OptionsManager
disableOption
in interface OptionsManager
option
- The option to be disabled.public void setValue(Option option, String value)
setValue
in interface OptionsManager
public List<Option> findByOptionValue(String value)
OptionsManager
findByOptionValue
in interface OptionsManager
value
- the value of the options to find (case insensitive). Must not be null.public List<Option> findByParentId(Long parentOptionId)
OptionsManager
findByParentId
in interface OptionsManager
parentOptionId
- the id of the parent option.@Nonnull public List<Option> getOptions(@Nonnull CustomField field, @Nonnull Collection<Long> projectIds, @Nonnull Collection<String> issueTypeIds)
OptionsManager
getOptions
in interface OptionsManager
field
- a custom field whose options are requestedprojectIds
- a collection of project idsissueTypeIds
- a collection of issue types idsSearchContext
,
CustomField.getReleventConfig(SearchContext)
,
FieldConfig
public void store(Option option)
Copyright © 2002-2024 Atlassian. All Rights Reserved.