Class QJavalinUtils
java.lang.Object
com.kingsrook.qqq.backend.javalin.QJavalinUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
handleException
(org.eclipse.jetty.http.HttpStatus.Code statusCode, io.javalin.http.Context context, Exception e) static void
handleQueryNullLimit
(QJavalinMetaData javalinMetaData, QueryInput queryInput, io.javalin.http.Context context) static Integer
integerFormParam
(io.javalin.http.Context context, String name) Returns Integer if context has a valid int form parameter by the given name, Returns null if no param (or empty value).static Integer
integerQueryParam
(io.javalin.http.Context context, String name) Returns Integer if context has a valid int query parameter by the given name, Returns null if no param (or empty value).static boolean
queryParamIsTrue
(io.javalin.http.Context context, String name) Returns true iff context has a valid query parameter by the given name, with a value of "true".static void
respondWithError
(io.javalin.http.Context context, org.eclipse.jetty.http.HttpStatus.Code statusCode, String errorMessage) static String
stringQueryParam
(io.javalin.http.Context context, String name) Returns String if context has a valid query parameter by the given name, Returns null if no param (or empty value).
-
Constructor Details
-
QJavalinUtils
public QJavalinUtils()
-
-
Method Details
-
integerQueryParam
public static Integer integerQueryParam(io.javalin.http.Context context, String name) throws QValueException Returns Integer if context has a valid int query parameter by the given name, Returns null if no param (or empty value). Throws QValueException for malformed numbers.- Throws:
QValueException
-
queryParamIsTrue
public static boolean queryParamIsTrue(io.javalin.http.Context context, String name) throws QValueException Returns true iff context has a valid query parameter by the given name, with a value of "true".- Throws:
QValueException
-
integerFormParam
public static Integer integerFormParam(io.javalin.http.Context context, String name) throws QValueException Returns Integer if context has a valid int form parameter by the given name, Returns null if no param (or empty value). Throws QValueException for malformed numbers.- Throws:
QValueException
-
stringQueryParam
-
handleException
public static void handleException(org.eclipse.jetty.http.HttpStatus.Code statusCode, io.javalin.http.Context context, Exception e) -
respondWithError
public static void respondWithError(io.javalin.http.Context context, org.eclipse.jetty.http.HttpStatus.Code statusCode, String errorMessage) -
handleQueryNullLimit
public static void handleQueryNullLimit(QJavalinMetaData javalinMetaData, QueryInput queryInput, io.javalin.http.Context context)
-