@ParametersAreNonnullByDefault public class OptionSetManagerImpl extends Object implements OptionSetManager
Constructor and Description |
---|
OptionSetManagerImpl(ConstantsManager constantsManager,
QueryDslAccessor queryDslAccessor) |
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 |
getOptionsForConfig(String fieldId,
Long configId) |
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.
|
public OptionSetManagerImpl(ConstantsManager constantsManager, QueryDslAccessor queryDslAccessor)
@Nonnull public OptionSet getOptionsForConfig(FieldConfig config)
OptionSetManager
getOptionsForConfig
in interface OptionSetManager
config
- the field configuration whose options are to be retrieved@Nonnull public OptionSet getOptionsForConfig(@Nonnull String fieldId, @Nonnull Long configId)
@Nonnull public OptionSet createOptionSet(FieldConfig config, Collection<String> optionIds)
OptionSetManager
Well... maybe. For historic reasons, a null
value is tolerated for optionIds
and is treated
the same as calling OptionSetManager.removeOptionSet(FieldConfig)
. It is now annotated with @Nonnull
to warn
callers that this should be avoided. Please call OptionSetManager.removeOptionSet(FieldConfig)
if that's what you
really mean!
By the way, this method and OptionSetManager.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.
createOptionSet
in interface OptionSetManager
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 public OptionSet updateOptionSet(FieldConfig config, Collection<String> optionIds)
OptionSetManager
Well... maybe. For historic reasons, a null
value is tolerated for optionIds
and is treated
the same as calling OptionSetManager.removeOptionSet(FieldConfig)
. It is now annotated with @Nonnull
to warn
callers that this should be avoided. Please call OptionSetManager.removeOptionSet(FieldConfig)
if that's what you
really mean!
By the way, this method and OptionSetManager.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.
updateOptionSet
in interface OptionSetManager
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 public OptionSet addOptionToOptionSet(FieldConfig config, String optionId)
OptionSetManager
addOptionToOptionSet
in interface OptionSetManager
config
- the field configuration associated with the option setoptionId
- to add to the option set@Nonnull public OptionSet removeOptionFromOptionSet(FieldConfig config, String optionId)
OptionSetManager
removeOptionFromOptionSet
in interface OptionSetManager
config
- the field configuration associated with the option setoptionId
- to remove from the option setpublic void removeOptionSet(FieldConfig config)
OptionSetManager
removeOptionSet
in interface OptionSetManager
config
- the field configuration to destroyCopyright © 2002-2019 Atlassian. All Rights Reserved.