Exemplo n.º 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;
 }
Exemplo n.º 2
0
 /** @return true if this is a negative cache result */
 public boolean isNegative() {
   return this.isCacheable() && NEGATIVE.equals(iv.getValue());
 }
Exemplo n.º 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));
 }