Enum FoodPreference
- java.lang.Object
-
- java.lang.Enum<FoodPreference>
-
- org.codehaus.mojo.jaxb2.schemageneration.postprocessing.javadoc.enums.FoodPreference
-
- All Implemented Interfaces:
Serializable
,Comparable<FoodPreference>
public enum FoodPreference extends Enum<FoodPreference>
Simple enumeration example defining some Food preferences.- Author:
- Lennart Jörelid, jGuru Europe AB
-
-
Enum Constant Summary
Enum Constants Enum Constant 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.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Enum Constant Detail
-
NONE
public static final FoodPreference NONE
No special food preferences; eats everything.
-
LACTO_VEGETARIAN
public static final FoodPreference LACTO_VEGETARIAN
Vegetarian who will not eat meats, but drinks milk.
-
VEGAN
public static final FoodPreference VEGAN
Vegan who will neither eat meats nor drink milk.
-
-
Method Detail
-
values
public static FoodPreference[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (FoodPreference c : FoodPreference.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static FoodPreference valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
isMeatEater
public boolean isMeatEater()
-
isMilkDrinker
public boolean isMilkDrinker()
-
-