java/webservice/src/main/java/be/bosa/dt/best/webservice/LookupResource.java
/**
	 * Return single result or "not found" JSON object
	 * 
	 * @param json
	 * @return response with single JSON result or a not found JSON object
	 */
Return single result or "not found" JSON object

@param json
@return response with single JSON result or a not found JSON object
Return single result or " not found " JSON object @param json @return response with single JSON result or a not found JSON object
private static RestResponse<JsonObject> responseOrEmpty(JsonObject json) {
		if (json != null) { 
			return RestResponse.ok(json);
		}
		JsonObject obj = new JsonObject();
		obj.put("type", "urn:problem-type:belgif:resourceNotFound");
		obj.put("href", "https://www.gcloud.belgium.be/rest/problems/resourceNotFound.html");
		obj.put("status", RestResponse.Status.NOT_FOUND.getStatusCode());
		return ResponseBuilder.create(RestResponse.Status.NOT_FOUND, obj).build();
	}
private static RestResponse < JsonObject > responseOrEmpty ( JsonObject json ) { if ( json != null ) { return RestResponse . ok ( json ) ; } JsonObject obj = new JsonObject ( ) ; obj . put ( "type" , "urn:problem-type:belgif:resourceNotFound" ) ; obj . put ( "href" , "https://www.gcloud.belgium.be/rest/problems/resourceNotFound.html" ) ; obj . put ( "status" , RestResponse . Status . NOT_FOUND . getStatusCode ( ) ) ; return ResponseBuilder . create ( RestResponse . Status . NOT_FOUND , obj ) . build ( ) ; }
Return single result or "not found" JSON object
Return single result or " not found " JSON object