public enum FoodPreference extends Enum<FoodPreference>
Enum Constant and Description |
---|
LACTO_VEGETARIAN
Vegetarian who will not eat meats, but drinks milk.
|
NONE
No special food preferences; eats everything.
|
VEGAN
Vegan who will neither eat meats nor drink milk.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isMeatEater() |
boolean |
isMilkDrinker() |
static FoodPreference |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static FoodPreference[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final FoodPreference NONE
public static final FoodPreference LACTO_VEGETARIAN
public static final FoodPreference VEGAN
public static FoodPreference[] values()
for (FoodPreference c : FoodPreference.values()) System.out.println(c);
public static FoodPreference valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic boolean isMeatEater()
public boolean isMilkDrinker()
Copyright © 2005–2016 MojoHaus. All rights reserved.