コード例 #1
0
ファイル: EntityMemcache.java プロジェクト: dalbani/objectify
 /** Get the entity stored at this bucket, possibly the one that was set */
 public Entity getEntity() {
   if (iv != null && iv.getValue() instanceof Entity) return (Entity) iv.getValue();
   else return null;
 }
コード例 #2
0
ファイル: EntityMemcache.java プロジェクト: dalbani/objectify
 /** @return true if this is a negative cache result */
 public boolean isNegative() {
   return this.isCacheable() && NEGATIVE.equals(iv.getValue());
 }
コード例 #3
0
ファイル: EntityMemcache.java プロジェクト: dalbani/objectify
 /**
  * "Empty" means we don't know the value - it could be null, it could be uncacheable, or we
  * could have some really weird unknown data in the cache. Basically, anything other than "yes
  * we have an entity/negative" is considered empty.
  *
  * @return true if this is empty or uncacheable or something other than a nice entity or
  *     negative result.
  */
 public boolean isEmpty() {
   return !this.isCacheable() || (!this.isNegative() && !(iv.getValue() instanceof Entity));
 }