package cli.category;

import category.CategoryName;
import category.CategoryUseCase;

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

public class CategoryCliAdapter {

	private final CategoryUseCase categoryUseCase;

	public CategoryCliAdapter(CategoryUseCase categoryUseCase) {
		this.categoryUseCase = categoryUseCase;
	}

	public void addCategory(String name) {
		categoryUseCase.addCategory(new CategoryName(name));
	}

	public Set<String> getCategories() {
		return categoryUseCase.getCategories().stream().map(Objects::toString).collect(Collectors.toSet());
	}

}
