Class TagConflictResolutionUtil.AutomaticChoiceGroup
- java.lang.Object
-
- org.openstreetmap.josm.gui.conflict.tags.TagConflictResolutionUtil.AutomaticChoiceGroup
-
- All Implemented Interfaces:
TagConflictResolutionUtil.AutomaticTagConflictResolver
- Enclosing class:
- TagConflictResolutionUtil
public static class TagConflictResolutionUtil.AutomaticChoiceGroup extends Object implements TagConflictResolutionUtil.AutomaticTagConflictResolver
Preference for an automatic tag conflict resolver which choose from a group of possiblechoice
values.- Since:
- 11606
-
-
Field Summary
Fields Modifier and Type Field Description (package private) List<TagConflictResolutionUtil.AutomaticChoice>
choices
The list of choice to choose from.(package private) String
group
The name of the group.boolean
isRegex
If regular expression must be used to match the Tag key.String
key
The Tag key to match.
-
Constructor Summary
Constructors Constructor Description AutomaticChoiceGroup(String key, String group, boolean isRegex, List<TagConflictResolutionUtil.AutomaticChoice> choices)
Instantiate an automatic tag conflict resolver which choose from a given list ofchoice
values.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Collection<TagConflictResolutionUtil.AutomaticChoiceGroup>
groupChoices(Collection<TagConflictResolutionUtil.AutomaticChoice> choices)
Group a given list ofTagConflictResolutionUtil.AutomaticChoice
by the Tag key and the choice group name.boolean
matchesKey(String k)
Check if this resolution apply to the given Tag key.String
resolve(Set<String> values)
Try to resolve a conflict between a set of values for a TagString
toString()
-
-
-
Constructor Detail
-
AutomaticChoiceGroup
public AutomaticChoiceGroup(String key, String group, boolean isRegex, List<TagConflictResolutionUtil.AutomaticChoice> choices)
Instantiate an automatic tag conflict resolver which choose from a given list ofchoice
values.- Parameters:
key
- The Tag key to match.group
- The name of the group.isRegex
- If regular expression must be used to match the Tag key.choices
- The list of choice to choose from.
-
-
Method Detail
-
groupChoices
public static Collection<TagConflictResolutionUtil.AutomaticChoiceGroup> groupChoices(Collection<TagConflictResolutionUtil.AutomaticChoice> choices)
Group a given list ofTagConflictResolutionUtil.AutomaticChoice
by the Tag key and the choice group name.- Parameters:
choices
- the list ofchoices
to group.- Returns:
- the resulting list of group.
-
matchesKey
public boolean matchesKey(String k)
Description copied from interface:TagConflictResolutionUtil.AutomaticTagConflictResolver
Check if this resolution apply to the given Tag key.- Specified by:
matchesKey
in interfaceTagConflictResolutionUtil.AutomaticTagConflictResolver
- Parameters:
k
- The Tag key to match.- Returns:
- true if this automatic resolution apply to the given Tag key.
-
resolve
public String resolve(Set<String> values)
Description copied from interface:TagConflictResolutionUtil.AutomaticTagConflictResolver
Try to resolve a conflict between a set of values for a Tag- Specified by:
resolve
in interfaceTagConflictResolutionUtil.AutomaticTagConflictResolver
- Parameters:
values
- the set of conflicting values for the Tag.- Returns:
- the resolved value or null if resolution was not possible.
-
-