package cli.tag;

import tag.CustomTagsUseCase;
import tag.TagName;
import tag.matcherImplementations.CustomTagMatcher;

import java.util.Set;
import java.util.stream.Collectors;

public class CustomTagsCliAdapter {

    private final CustomTagsUseCase customTagsUseCase;

    public CustomTagsCliAdapter(CustomTagsUseCase customTagsUseCase) {
        this.customTagsUseCase = customTagsUseCase;
    }

    public void addCustomTagMatcher(String name, String regexString) {
        customTagsUseCase.addCustomTagMatcher(new CustomTagMatcher(new TagName(name), regexString));
    }

    public Set<String> getAllTagNames() {
        return customTagsUseCase.getAllTagNames().stream().map(TagName::toString).collect(Collectors.toSet());
    }
}
