Example #1
0
 @Override
 public final boolean equals(final Object other) {
   if (this == other) {
     return true;
   } else if (other instanceof Issue) {
     final Issue otherIssue = (Issue) other;
     if (this.getId() == otherIssue.getId()
         && this.getName().equals(otherIssue.getName())
         && this.getDescription().equals(otherIssue.getDescription())
         && this.getPriority() == otherIssue.getPriority()) {
       return true;
     }
   }
   return false;
 }
 @Override
 @POST
 @Path("/issue")
 public Response addIssue(final Issue issue) {
   try {
     ticketSystemService.addIssue(issue);
     final URI location = uriInfo.getAbsolutePathBuilder().path("" + issue.getId()).build();
     return Response.created(location).build();
   } catch (final TicketSystemServiceException exception) {
     return Response.status(400).entity(exception).build();
   }
 }