Examples of WebApplicationException


Examples of javax.ws.rs.WebApplicationException

   */
  public static void assertPositive(Number obj, String fieldName) {
    assertNotNull(obj, fieldName);
    if (obj.intValue() < 0) {
      log.warn("Field '{}' should be positive", fieldName);
      throw new WebApplicationException(Response.Status.BAD_REQUEST);
    }
  }
View Full Code Here

Examples of javax.ws.rs.WebApplicationException

   */
  public static void assertPresent(Optional obj, String fieldName) {
    assertNotNull(obj, fieldName);
    if (!obj.isPresent()) {
      log.warn("Field '{}' should be present", fieldName);
      throw new WebApplicationException(Response.Status.BAD_REQUEST);
    }
  }
View Full Code Here

Examples of javax.ws.rs.WebApplicationException

   */
  public static void assertNotConflicted(Optional obj, String fieldName) {
    assertNotNull(obj, fieldName);
    if (obj.isPresent()) {
      log.warn("Field '{}' should be absent to avoid conflict", fieldName);
      throw new WebApplicationException(Response.Status.CONFLICT);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.