public static class TagConflictResolutionUtil.AutomaticChoiceGroup extends java.lang.Object implements TagConflictResolutionUtil.AutomaticTagConflictResolver
choice
values.Modifier and Type | Field and Description |
---|---|
(package private) java.util.List<TagConflictResolutionUtil.AutomaticChoice> |
choices
The list of choice to choose from.
|
(package private) java.lang.String |
group
The name of the group.
|
boolean |
isRegex
If regular expression must be used to match the Tag key.
|
java.lang.String |
key
The Tag key to match.
|
Constructor and Description |
---|
AutomaticChoiceGroup(java.lang.String key,
java.lang.String group,
boolean isRegex,
java.util.List<TagConflictResolutionUtil.AutomaticChoice> choices)
Instantiate an automatic tag conflict resolver which choose from
a given list of
choice values. |
Modifier and Type | Method and Description |
---|---|
static java.util.Collection<TagConflictResolutionUtil.AutomaticChoiceGroup> |
groupChoices(java.util.Collection<TagConflictResolutionUtil.AutomaticChoice> choices)
Group a given list of
TagConflictResolutionUtil.AutomaticChoice by the Tag key and the choice group name. |
boolean |
matchesKey(java.lang.String k)
Check if this resolution apply to the given Tag key.
|
java.lang.String |
resolve(java.util.Set<java.lang.String> values)
Try to resolve a conflict between a set of values for a Tag
|
java.lang.String |
toString() |
public java.lang.String key
final java.lang.String group
public boolean isRegex
final java.util.List<TagConflictResolutionUtil.AutomaticChoice> choices
public AutomaticChoiceGroup(java.lang.String key, java.lang.String group, boolean isRegex, java.util.List<TagConflictResolutionUtil.AutomaticChoice> choices)
choice
values.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.public static java.util.Collection<TagConflictResolutionUtil.AutomaticChoiceGroup> groupChoices(java.util.Collection<TagConflictResolutionUtil.AutomaticChoice> choices)
TagConflictResolutionUtil.AutomaticChoice
by the Tag key and the choice group name.choices
- the list of choices
to group.public boolean matchesKey(java.lang.String k)
TagConflictResolutionUtil.AutomaticTagConflictResolver
matchesKey
in interface TagConflictResolutionUtil.AutomaticTagConflictResolver
k
- The Tag key to match.public java.lang.String resolve(java.util.Set<java.lang.String> values)
TagConflictResolutionUtil.AutomaticTagConflictResolver
resolve
in interface TagConflictResolutionUtil.AutomaticTagConflictResolver
values
- the set of conflicting values for the Tag.public java.lang.String toString()
toString
in class java.lang.Object