public static void checkParam ( boolean expression , Object errorMessage ) { if ( ! expression ) { Response response = Response . status ( Response . Status . BAD_REQUEST ) . type ( MediaType . TEXT_PLAIN ) . build ( ) ; throw new WebApplicationException ( String . valueOf ( errorMessage ) , response ) ; } }
Ensures the truth of an expression involving a jax - rs parameter .