// Path: src/main/java/info/interactivesystems/gamificationengine/api/exeption/ApiError.java
// @ApplicationException
// public class ApiError extends WebApplicationException {
// 
// 	private static final long serialVersionUID = 1L;
// 
// 	/**
// 	 * 
// 	 * @param status
// 	 *            a HTTP status code.
// 	 * @param message
// 	 *            a description of the error cause.
// 	 */
// 	public ApiError(Response.Status status, String message) {
// 		this(status, message, new Object[] {});
// 	}
// 
// 	/**
// 	 * @param status
// 	 *            a HTTP status code
// 	 * @param message
// 	 *            a description of the error cause, may be a formatted string.
// 	 * @param args
// 	 *            for format string, may be zero, see {@link String#format test}
// 	 *            .
// 	 */
// 	public ApiError(Response.Status status, String message, Object... args) {
// 		super(ResponseSurrogate.of(status, null, Notification.of(String.format(message, args))));
// 	}
// }


import info.interactivesystems.gamificationengine.api.exeption.ApiError;
import javax.ws.rs.core.Response;
package info.interactivesystems.gamificationengine.api;



public class ValidateUtils {

	/**
	 * Validates whether the assigned object is null.
	 * 
	 * @param id
	 *           The id of the object. This is needed for output.
	 * @param object
	 *          The object that is tested.
	 *
	 * @return Validated object identity
	 */
	public static <T> T requireNotNull(int id, T object) {
		if (object == null) {
// Path: src/main/java/info/interactivesystems/gamificationengine/api/exeption/ApiError.java
// @ApplicationException
// public class ApiError extends WebApplicationException {
// 
// 	private static final long serialVersionUID = 1L;
// 
// 	/**
// 	 * 
// 	 * @param status
// 	 *            a HTTP status code.
// 	 * @param message
// 	 *            a description of the error cause.
// 	 */
// 	public ApiError(Response.Status status, String message) {
// 		this(status, message, new Object[] {});
// 	}
// 
// 	/**
// 	 * @param status
// 	 *            a HTTP status code
// 	 * @param message
// 	 *            a description of the error cause, may be a formatted string.
// 	 * @param args
// 	 *            for format string, may be zero, see {@link String#format test}
// 	 *            .
// 	 */
// 	public ApiError(Response.Status status, String message, Object... args) {
// 		super(ResponseSurrogate.of(status, null, Notification.of(String.format(message, args))));
// 	}
// }


// Path: src/main/java/info/interactivesystems/gamificationengine/api/ValidateUtils.java
import info.interactivesystems.gamificationengine.api.exeption.ApiError;
import javax.ws.rs.core.Response;

package info.interactivesystems.gamificationengine.api;



public class ValidateUtils {

	/**
	 * Validates whether the assigned object is null.
	 * 
	 * @param id
	 *           The id of the object. This is needed for output.
	 * @param object
	 *          The object that is tested.
	 *
	 * @return Validated object identity
	 */
	public static <T> T requireNotNull(int id, T object) {
		if (object == null) {
			throw new ApiError(Response.Status.NOT_FOUND, "No such id: %s", id);