private Long withCaching(final OperationRetrieval<Long> op, @Nullable final UUID objectId, final ObjectType objectType, @Nullable final CacheController<Object, Object> cache) { if (objectId == null) { return null; } if (cache != null) { return (Long) cache.get(objectId.toString(), new CacheLoaderArgument(objectType)); } return op.doRetrieve(objectId, objectType); } }
result = cache.get(cacheKey, cacheLoaderArgument);
private Long retrieveRecordIdFromCache(UUID tagId) { final CacheController<Object, Object> cache = controlCacheDispatcher.getCacheController(CacheType.RECORD_ID); Object result = null; if (cache != null) { // Keys are upper cased by convention result = cache.get(tagId.toString().toUpperCase(), new CacheLoaderArgument(ObjectType.TAG)); } return (Long) result; }