@SuppressWarnings("unchecked")
	public static Inflector<ContainerRequestContext, Response> addConstrHandler(final App a) {
		return new Inflector<ContainerRequestContext, Response>() {
			public Response apply(ContainerRequestContext ctx) {
				App app = (a != null) ? a : getPrincipalApp();
				String type = pathParam(Config._TYPE, ctx);
				String field = pathParam("field", ctx);
				String cname = pathParam("cname", ctx);
				if (app != null) {
					Response payloadRes = getEntity(ctx.getEntityStream(), Map.class);
					if (payloadRes.getStatusInfo() == Response.Status.OK) {
						Map<String, Object> payload = (Map<String, Object>) payloadRes.getEntity();
						if (app.addValidationConstraint(type, field, Constraint.build(cname, payload))) {
							app.update();
						}
					}
					return Response.ok(app.getAllValidationConstraints(type)).build();
				}
				return getStatusResponse(Response.Status.NOT_FOUND, "App not found.");
			}
		};
	}
@ SuppressWarnings ( "unchecked" ) public static Inflector < ContainerRequestContext , Response > addConstrHandler ( final App a ) { return new Inflector < ContainerRequestContext , Response > ( ) { public Response apply ( ContainerRequestContext ctx ) { App app = ( a != null ) ? a : getPrincipalApp ( ) ; String type = pathParam ( Config . _TYPE , ctx ) ; String field = pathParam ( "field" , ctx ) ; String cname = pathParam ( "cname" , ctx ) ; if ( app != null ) { Response payloadRes = getEntity ( ctx . getEntityStream ( ) , Map . class ) ; if ( payloadRes . getStatusInfo ( ) == Response . Status . OK ) { Map < String , Object > payload = ( Map < String , Object > ) payloadRes . getEntity ( ) ; if ( app . addValidationConstraint ( type , field , Constraint . build ( cname , payload ) ) ) { app . update ( ) ; } } return Response . ok ( app . getAllValidationConstraints ( type ) ) . build ( ) ; } return getStatusResponse ( Response . Status . NOT_FOUND , "App not found." ) ; } } ; }
@param a {@link App}
@return response