Interface OptionSetManager
- All Known Implementing Classes:
CachedOptionSetManager,OptionSetManagerImpl
-
Method Summary
Modifier and TypeMethodDescriptionaddOptionToOptionSet(FieldConfig config, String optionId) Adds a new option to the option set.createOptionSet(FieldConfig config, Collection<String> optionIds) Creates a new option set or replaces an existing one.getOptionsForConfig(FieldConfig config) Retrieves an option set that contains the options for the given field configuration.removeOptionFromOptionSet(FieldConfig config, String optionId) Removes an option from the option set.voidremoveOptionSet(FieldConfig config) Removes all options from this field configuration.updateOptionSet(FieldConfig config, Collection<String> optionIds) Creates a new option set or replaces an existing one.
-
Method Details
-
getOptionsForConfig
Retrieves an option set that contains the options for the given field configuration.- Parameters:
config- the field configuration whose options are to be retrieved- Returns:
- an option set containing the options for that field configuration
-
createOptionSet
Creates a new option set or replaces an existing one.Well... maybe. For historic reasons, a
nullvalue is tolerated foroptionIdsand is treated the same as callingremoveOptionSet(FieldConfig). It is now annotated with@Nonnullto warn callers that this should be avoided. Please callremoveOptionSet(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.- Parameters:
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 aListorSortedSetif you want the results to be predictable.- Returns:
- the set of options assigned to this field configuration
-
updateOptionSet
Creates a new option set or replaces an existing one.Well... maybe. For historic reasons, a
nullvalue is tolerated foroptionIdsand is treated the same as callingremoveOptionSet(FieldConfig). It is now annotated with@Nonnullto warn callers that this should be avoided. Please callremoveOptionSet(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.- Parameters:
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 aListorSortedSetif you want the results to be predictable.- Returns:
- the set of options assigned to this field configuration
-
addOptionToOptionSet
Adds a new option to the option set. This will be placed in the last position of the set (highest sequence).- Parameters:
config- the field configuration associated with the option setoptionId- to add to the option set- Returns:
- the set of options assigned to this field configuration
-
removeOptionFromOptionSet
Removes an option from the option set.- Parameters:
config- the field configuration associated with the option setoptionId- to remove from the option set- Returns:
- the set of options assigned to this field configuration
-
removeOptionSet
Removes all options from this field configuration.- Parameters:
config- the field configuration to destroy
-