示例#1
0
 /** 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
 /** @return true if this is a negative cache result */
 public boolean isNegative() {
   return this.isCacheable() && NEGATIVE.equals(iv.getValue());
 }
示例#3
0
 /**
  * "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));
 }