package ru.kayashov.bar.model.entity;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

@Getter
@RequiredArgsConstructor
public enum Category {
    COCKTAIL("Коктейль"),
    BEER("Пиво"),
    SHOT("Шот"),
    COFFEE_TEA("Кофе-Чай"),
    SOFT("Безалкогольный напиток");

    private final String name;

    public static Category findValue(String name) {
        for (Category category : Category.values()) {
            if (category.getName().equals(name)) {
                return category;
            }
        }
        throw new IllegalArgumentException();
    }
}
