Code example for Cache

Methods: getIfPresent

0
        this.vertexIdCache.put(hash, entityVertex.getId());
        this.vertexCache.put(hash, entityVertex);
    } 
 
    public Vertex getVertex(Graph graph, String hash, Authorizations authorizations) {
        Vertex vertex = vertexCache.getIfPresent(hash);
        if (vertex != null) {
            return vertex;
        } 
 
        String vertexId = getCachedVertexId(hash);
        if (vertexId != null) {
            return graph.getVertex(vertexId, authorizations);
        } 
 
        return null; 
    } 
} 
Contextual code suggestions in your IDE  Get Codota for Java