Enum AgeRange
- java.lang.Object
-
- java.lang.Enum<AgeRange>
-
- org.springframework.social.google.api.plus.AgeRange
-
- All Implemented Interfaces:
Serializable,Comparable<AgeRange>
public enum AgeRange extends Enum<AgeRange>
Enum representing a user's age range. Valid ranges are 17 or younger, 18 to 20, and 21 or older.- Author:
- Michal Szwed
-
-
Enum Constant Summary
Enum Constants Enum Constant Description AGE_17_MINUSAGE_18_20AGE_21_PLUSUNKNOWN
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AgeRangefromMinMax(Integer min, Integer max)Constructs an AgeRange from the min/max age values.IntegergetMax()IntegergetMin()static AgeRangevalueOf(String name)Returns the enum constant of this type with the specified name.static AgeRange[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Method Detail
-
values
public static AgeRange[] 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 (AgeRange c : AgeRange.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static AgeRange 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
-
fromMinMax
public static AgeRange fromMinMax(Integer min, Integer max)
Constructs an AgeRange from the min/max age values.- Parameters:
min- The minimum agemax- The maximum age- Returns:
- an AgeRange
-
getMin
public Integer getMin()
- Returns:
- The minimum integer value for the range (possibly null).
-
getMax
public Integer getMax()
- Returns:
- The maximum integer value for the range (possibly null).
-
-