ehcache

net.sf.ehcache.search
Interface Result

All Known Implementing Classes:
AggregateOnlyResult, BaseResult, GroupedResultImpl, ResultImpl

public interface Result

Represents a single cache entry that has been selected by a cache query.

Author:
teck, Greg Luck

Method Summary
 List<Object> getAggregatorResults()
          Retrieve the aggregator value(s)
<T> T
getAttribute(Attribute<T> attribute)
          Retrieve the given attribute value for this cache entry
 Object getKey()
          Return the key for this cache entry.
 Object getValue()
          Return the value for this cache entry.
 

Method Detail

getKey

Object getKey()
              throws SearchException
Return the key for this cache entry.

Returns:
key object
Throws:
SearchException - if keys were not selected by the originating query

getValue

Object getValue()
                throws SearchException
Return the value for this cache entry.

Returns:
value object. This value might be null if the value is no longer referenced by the cache (ie. a concurrent update removed this entry).
Throws:
SearchException - if values were not selected by the originating query

getAttribute

<T> T getAttribute(Attribute<T> attribute)
               throws SearchException
Retrieve the given attribute value for this cache entry

Parameters:
attribute - the attribute to retrieve
Returns:
the attribute value, or null if there is none
Throws:
SearchException - if the given attribute was not explicitly selected by the originating query

getAggregatorResults

List<Object> getAggregatorResults()
                                  throws SearchException
Retrieve the aggregator value(s)

Returns:
the aggregators value as a List. The aggregator results will be in the same order they were added to the query
Throws:
SearchException - if no aggregators were requested in the query

ehcache

Copyright 2001-2015, Terracotta, Inc.