Code example for Cache

Methods: getIfPresent

0
    cache.put(new CredentialKey(tenantId, clusterId), fields);
  } 
 
  @Override 
  public Map<String, Object> get(String tenantId, String clusterId) {
    Map<String, Object> result = cache.getIfPresent(new CredentialKey(tenantId, clusterId));
    return result == null ? Collections.<String, Object>emptyMap() : result;
  } 
 
  @Override 
  public void wipe(String tenantId, String clusterId) {
    cache.invalidate(new CredentialKey(tenantId, clusterId));
  } 
 
  @Override 
  public void wipe() { 
    cache.invalidateAll(); 
  } 
 
  @Override