Package httpserver.core
Enum Class InputParser
- All Implemented Interfaces:
Serializable,Comparable<InputParser>,Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Method Summary
Modifier and TypeMethodDescriptionstatic intgetBoundedInteger(HttpServerExchange exchange, String parameter, int minimum, int defaultValue, int maximum) static intgetBoundedInteger(Map<String, String> formData, String parameter, int minimum, int defaultValue, int maximum) static longgetBoundedLong(HttpServerExchange exchange, String parameter, long minimum, long defaultValue, long maximum) static longgetBoundedLong(Map<String, String> formData, String parameter, long minimum, long defaultValue, long maximum) static doublegetMandatoryDouble(HttpServerExchange exchange, String parameter) static doublegetMandatoryDouble(Map<String, String> formData, String parameter) static StringgetMandatoryEmailAddress(HttpServerExchange exchange, String parameter) static StringgetMandatoryEmailAddress(Map<String, String> formData, String parameter) static intgetMandatoryInteger(HttpServerExchange exchange, String parameter) static intgetMandatoryInteger(Map<String, String> formData, String parameter) static longgetMandatoryLong(HttpServerExchange exchange, String parameter) static longgetMandatoryLong(Map<String, String> formData, String parameter) static StringgetMandatoryString(HttpServerExchange exchange, String parameter) static StringgetMandatoryString(Map<String, String> formData, String parameter) static booleangetOptionalBoolean(HttpServerExchange exchange, String parameter, boolean defaultValue) static booleangetOptionalBoolean(Map<String, String> formData, String parameter, boolean defaultValue) static DoublegetOptionalDouble(HttpServerExchange exchange, String parameter, Double defaultValue) static Doublestatic IntegergetOptionalInteger(HttpServerExchange exchange, String parameter, Integer defaultValue) static Integerstatic LonggetOptionalLong(HttpServerExchange exchange, String parameter, Long defaultValue) static Longstatic StringgetOptionalString(HttpServerExchange exchange, String parameter, String defaultValue) static Stringstatic InputParserReturns the enum constant of this class with the specified name.static InputParser[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-
getMandatoryString
public static String getMandatoryString(Map<String, String> formData, String parameter) throws InvalidInput- Throws:
InvalidInput
-
getMandatoryInteger
public static int getMandatoryInteger(Map<String, String> formData, String parameter) throws InvalidInput- Throws:
InvalidInput
-
getMandatoryLong
public static long getMandatoryLong(Map<String, String> formData, String parameter) throws InvalidInput- Throws:
InvalidInput
-
getMandatoryDouble
public static double getMandatoryDouble(Map<String, String> formData, String parameter) throws InvalidInput- Throws:
InvalidInput
-
getMandatoryEmailAddress
public static String getMandatoryEmailAddress(Map<String, String> formData, String parameter) throws InvalidInput- Throws:
InvalidInput
-
getOptionalString
public static String getOptionalString(Map<String, String> formData, String parameter, String defaultValue) throws InvalidInput- Throws:
InvalidInput
-
getOptionalInteger
public static Integer getOptionalInteger(Map<String, String> formData, String parameter, Integer defaultValue) throws InvalidInput- Throws:
InvalidInput
-
getBoundedInteger
public static int getBoundedInteger(Map<String, String> formData, String parameter, int minimum, int defaultValue, int maximum) throws InvalidInput- Throws:
InvalidInput
-
getOptionalLong
public static Long getOptionalLong(Map<String, String> formData, String parameter, Long defaultValue) throws InvalidInput- Throws:
InvalidInput
-
getBoundedLong
public static long getBoundedLong(Map<String, String> formData, String parameter, long minimum, long defaultValue, long maximum) throws InvalidInput- Throws:
InvalidInput
-
getOptionalDouble
public static Double getOptionalDouble(Map<String, String> formData, String parameter, Double defaultValue) throws InvalidInput- Throws:
InvalidInput
-
getOptionalBoolean
public static boolean getOptionalBoolean(Map<String, String> formData, String parameter, boolean defaultValue) throws InvalidInput- Throws:
InvalidInput
-
getMandatoryString
public static String getMandatoryString(HttpServerExchange exchange, String parameter) throws InvalidInput - Throws:
InvalidInput
-
getMandatoryInteger
public static int getMandatoryInteger(HttpServerExchange exchange, String parameter) throws InvalidInput - Throws:
InvalidInput
-
getMandatoryLong
public static long getMandatoryLong(HttpServerExchange exchange, String parameter) throws InvalidInput - Throws:
InvalidInput
-
getMandatoryDouble
public static double getMandatoryDouble(HttpServerExchange exchange, String parameter) throws InvalidInput - Throws:
InvalidInput
-
getMandatoryEmailAddress
public static String getMandatoryEmailAddress(HttpServerExchange exchange, String parameter) throws InvalidInput - Throws:
InvalidInput
-
getOptionalString
public static String getOptionalString(HttpServerExchange exchange, String parameter, String defaultValue) throws InvalidInput - Throws:
InvalidInput
-
getOptionalInteger
public static Integer getOptionalInteger(HttpServerExchange exchange, String parameter, Integer defaultValue) throws InvalidInput - Throws:
InvalidInput
-
getBoundedInteger
public static int getBoundedInteger(HttpServerExchange exchange, String parameter, int minimum, int defaultValue, int maximum) throws InvalidInput - Throws:
InvalidInput
-
getOptionalLong
public static Long getOptionalLong(HttpServerExchange exchange, String parameter, Long defaultValue) throws InvalidInput - Throws:
InvalidInput
-
getBoundedLong
public static long getBoundedLong(HttpServerExchange exchange, String parameter, long minimum, long defaultValue, long maximum) throws InvalidInput - Throws:
InvalidInput
-
getOptionalDouble
public static Double getOptionalDouble(HttpServerExchange exchange, String parameter, Double defaultValue) throws InvalidInput - Throws:
InvalidInput
-
getOptionalBoolean
public static boolean getOptionalBoolean(HttpServerExchange exchange, String parameter, boolean defaultValue) throws InvalidInput - Throws:
InvalidInput
-