Code example for AtomicLong

Methods: getAndIncrement

0
    } 
 
    @GET 
    @Timed(name = "get-requests") 
    @CacheControl(maxAge = 1, maxAgeUnit = TimeUnit.DAYS)
    public Saying sayHello(@QueryParam("name") Optional<String> name) {
        return new Saying(counter.incrementAndGet(), template.render(name));
    } 
}