io.rtr.alchemy.service.resources.BaseResource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of alchemy-service Show documentation
Show all versions of alchemy-service Show documentation
REST service for hosting Alchemy as a service
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