This commit is contained in:
parent
135c7e2ad9
commit
11cf674d9c
21
2-Application/src/main/java/tag/TaggingUseCase.java
Normal file
21
2-Application/src/main/java/tag/TaggingUseCase.java
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
package tag;
|
||||||
|
|
||||||
|
import link.LinkUrl;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
public class TaggingUseCase {
|
||||||
|
|
||||||
|
TagMatcherRepository tagMatcherRepository;
|
||||||
|
|
||||||
|
public TaggingUseCase(TagMatcherRepository tagMatcherRepository) {
|
||||||
|
this.tagMatcherRepository = tagMatcherRepository;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<Tag> getTagsFor(LinkUrl url) {
|
||||||
|
Set<Tag> result = Set.of();
|
||||||
|
tagMatcherRepository.getTagMatchers().forEach(tagMatcher -> tagMatcher.ifMatches(url).addTo(result));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Reference in a new issue