Package net.sf.ehcache.search
Interface Result
-
- All Known Implementing Classes:
AggregateOnlyResult,BaseResult,GroupedResultImpl,ResultImpl
public interface ResultRepresents a single cache entry that has been selected by a cache query.- Author:
- teck, Greg Luck
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<java.lang.Object>getAggregatorResults()Retrieve the aggregator value(s)<T> TgetAttribute(Attribute<T> attribute)Retrieve the given attribute value for this cache entryjava.lang.ObjectgetKey()Return the key for this cache entry.java.lang.ObjectgetValue()Return the value for this cache entry.
-
-
-
Method Detail
-
getKey
java.lang.Object getKey() throws SearchExceptionReturn the key for this cache entry.- Returns:
- key object
- Throws:
SearchException- if keys were not selected by the originating query
-
getValue
java.lang.Object getValue() throws SearchExceptionReturn 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
java.util.List<java.lang.Object> getAggregatorResults() throws SearchExceptionRetrieve 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
-
-