Class TagConflictResolutionUtil.AutomaticChoice

    • Field Detail

      • key

        public String key
        The Tag key to match.
      • group

        public String group
        The name of the {link AutomaticChoice group} this choice belongs to.
      • isRegex

        public boolean isRegex
        If regular expression must be used to match the Tag key or the value.
      • score

        public String score
        The score to give to this choice in order to choose the best value Natural String ordering is used to identify the best score.
    • Constructor Detail

      • AutomaticChoice

        public AutomaticChoice​(String key,
                               String group,
                               String description,
                               boolean isRegex,
                               String value,
                               String score)
        Instantiate a particular choice from a group for automatic tag conflict resolution.
        Parameters:
        key - The Tag key to match.
        group - The name of the {link AutomaticChoice group} this choice belongs to.
        description - A free description.
        isRegex - If regular expression must be used to match the Tag key or the value.
        value - The Tag value to match.
        score - The score to give to this choice in order to choose the best value.
    • Method Detail

      • matchesValue

        public boolean matchesValue​(String v)
        Check if this choice match the given Tag value.
        Parameters:
        v - the Tag value to match.
        Returns:
        true if this choice correspond to the given tag value.
      • computeScoreFromValue

        public String computeScoreFromValue​(String v)
        Return the score associated to this choice for the given Tag value. For the result to be valid the given tag value must match this choice.
        Parameters:
        v - the Tag value of which to get the score.
        Returns:
        the score associated to the given Tag value.
        Throws:
        PatternSyntaxException - if the regular expression syntax is invalid