Code example for Cache

Methods: getIfPresentinvalidate

0
        } 
    } 
 
    @DELETE 
    public Response delete(@PathParam("id") String scanId) { 
        RecordScanner scanner = this.recordScannerMap.getIfPresent(scanId); 
        if (scanner != null) { 
            scanner.close(); 
            this.recordScannerMap.invalidate(scanId); 
            return Response.ok().build(); 
        } else { 
            throw new ResourceException("No scan with ID " + scanId + " found", NOT_FOUND.getStatusCode()); 
        } 
    } 
} 
Contextual code suggestions in your IDE  Get Codota for Java