Exemplo n.º 1
0
  @POST
  @Path("/add")
  public Response add(Saying saying) {

    saying.setResult(saying.getNumber1() + saying.getNumber2());
    return Response.status(201).entity(saying).build();
  }
Exemplo n.º 2
0
 @GET
 @Timed
 public Saying sayHello(@QueryParam("name") Optional<String> name) {
   Saying saying = new Saying();
   saying.setNumber1(12);
   saying.setNumber2(23);
   saying.setResult(1563);
   return new Saying();
   //        return new Saying(counter.incrementAndGet(),
   //                          String.format(template, name.or(defaultName)));
 }