All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.rtr.alchemy.service.resources.BaseResource Maven / Gradle / Ivy

There is a newer version: 2.2.16
Show newest version
package io.rtr.alchemy.service.resources;

import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;

/**
 * Base resource with various helper methods
 */
public abstract class BaseResource {
    protected static   T ensureExists(T value) {
        if (value == null) {
            throw new WebApplicationException(Response.Status.NOT_FOUND);
        }

        return value;
    }

    protected static Response created() {
        return Response.status(Response.Status.CREATED).build();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy