Files
my-bar/src/main/java/ru/kayashov/bar/model/entity/Glass.java

34 lines
984 B
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package ru.kayashov.bar.model.entity;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
@Getter
@RequiredArgsConstructor
public enum Glass {
HIGHBALL("Хайболл",250),
COCKTAIL("Коктейльный бокал",120),
COLLINS("Стакан", 200),
CHAMPAGNE("Бокал флюте", 200),
HURRICANE("Ураган", 350),
COFFEE("Кофейная кружка", 250),
SHOT("Рюмка",50),
CORDIAL("Ликерная рюмка",150),
BEER("Пивной бокал", 500),
WINE("Бокал для вина", 350),
MARGARITA("Бокал Маргарита", 260);
private final String name;
private final Integer capacity;
public static Glass findValue(String name) {
for (Glass glass : Glass.values()) {
if (glass.name.equals(name)) {
return glass;
}
}
throw new RuntimeException("Не существует значение " + name);
}
}