@ParametersAreNonnullByDefault @PublicApi public interface OptionSetManager
Modifier and Type | Method and Description |
---|---|
OptionSet |
addOptionToOptionSet(FieldConfig config,
String optionId)
Adds a new option to the option set.
|
OptionSet |
createOptionSet(FieldConfig config,
Collection<String> optionIds)
Creates a new option set or replaces an existing one.
|
OptionSet |
getOptionsForConfig(FieldConfig config)
Retrieves an option set that contains the options for the given field configuration.
|
OptionSet |
removeOptionFromOptionSet(FieldConfig config,
String optionId)
Removes an option from the option set.
|
void |
removeOptionSet(FieldConfig config)
Removes all options from this field configuration.
|
OptionSet |
updateOptionSet(FieldConfig config,
Collection<String> optionIds)
Creates a new option set or replaces an existing one.
|
@Nonnull OptionSet getOptionsForConfig(FieldConfig config)
config
- the field configuration whose options are to be retrieved@Nonnull OptionSet createOptionSet(FieldConfig config, Collection<String> optionIds)
Well... maybe. For historic reasons, a null
value is tolerated for optionIds
and is treated
the same as calling removeOptionSet(FieldConfig)
. It is now annotated with @Nonnull
to warn
callers that this should be avoided. Please call removeOptionSet(FieldConfig)
if that's what you
really mean!
By the way, this method and updateOptionSet(FieldConfig, Collection)
do exactly
the same thing. Don't ask me why we have both of them; I'm sure it seemed like a great idea at the time.
config
- the field configuration associated with the option setoptionIds
- the collection of options to include. The options will be ordered by the iteration order
of the collection, so it should be a List
or SortedSet
if you want the
results to be predictable.@Nonnull OptionSet updateOptionSet(FieldConfig config, Collection<String> optionIds)
Well... maybe. For historic reasons, a null
value is tolerated for optionIds
and is treated
the same as calling removeOptionSet(FieldConfig)
. It is now annotated with @Nonnull
to warn
callers that this should be avoided. Please call removeOptionSet(FieldConfig)
if that's what you
really mean!
By the way, this method and createOptionSet(FieldConfig, Collection)
do exactly
the same thing. Don't ask me why we have both of them; I'm sure it seemed like a great idea at the time.
config
- the field configuration associated with the option setoptionIds
- the collection of options to include. The options will be ordered by the iteration order
of the collection, so it should be a List
or SortedSet
if you want the
results to be predictable.@Nonnull OptionSet addOptionToOptionSet(FieldConfig config, String optionId)
config
- the field configuration associated with the option setoptionId
- to add to the option set@Nonnull OptionSet removeOptionFromOptionSet(FieldConfig config, String optionId)
config
- the field configuration associated with the option setoptionId
- to remove from the option setvoid removeOptionSet(FieldConfig config)
config
- the field configuration to destroyCopyright © 2002-2018 Atlassian. All Rights Reserved.