1.9.30 sync.
[gae.git] / java / src / main / com / google / appengine / api / datastore / EntityCachingCriteria.java
blobb56a871732810d9ddf147f966be120e529c2d7ea
1 package com.google.appengine.api.datastore;
3 /**
4 * Specifies whether the entity associated with the {@link Key} is eligible for caching.
5 */
6 abstract class EntityCachingCriteria {
8 /**
9 * Returns that every entity is cacheable.
11 public static final EntityCachingCriteria ALL_KEYS = new EntityCachingCriteria() {
12 @Override
13 public boolean isCacheable(Key key) {
14 return true;
18 /**
19 * Returns whether the entity associated with the {@code key} is eligible for caching.
21 * @param key the entity {@link Key} to check.
22 * @return {@code true} if the entity with the specified {@code key} is cacheable.
23 * {@code false} otherwise.
25 public abstract boolean isCacheable(Key key);