Package net.sf.ehcache.search.impl
Class BaseResult
- java.lang.Object
-
- net.sf.ehcache.search.impl.BaseResult
-
- All Implemented Interfaces:
Result
- Direct Known Subclasses:
AggregateOnlyResult,GroupedResultImpl,ResultImpl
public abstract class BaseResult extends java.lang.Object implements Result
Base result implementation- Author:
- teck
-
-
Constructor Summary
Constructors Constructor Description BaseResult(StoreQuery query)Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract java.lang.ObjectbasicGetAttribute(java.lang.String name)Get the actual attribute valueprotected abstract java.lang.ObjectbasicGetKey()Get the actual key valueprotected abstract java.lang.ObjectbasicGetValue()Get the actual valuejava.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.voidsetAggregateResults(java.util.List<java.lang.Object> aggregateResults)Set the aggregate results for this rowjava.lang.StringtoString()
-
-
-
Constructor Detail
-
BaseResult
public BaseResult(StoreQuery query)
Constructor- Parameters:
query-
-
-
Method Detail
-
setAggregateResults
public void setAggregateResults(java.util.List<java.lang.Object> aggregateResults)
Set the aggregate results for this row- Parameters:
aggregateResults-
-
getKey
public java.lang.Object getKey()
Return the key for this cache entry.
-
basicGetKey
protected abstract java.lang.Object basicGetKey()
Get the actual key value- Returns:
- key
-
getAggregatorResults
public java.util.List<java.lang.Object> getAggregatorResults() throws SearchExceptionRetrieve the aggregator value(s)- Specified by:
getAggregatorResultsin interfaceResult- 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
-
getValue
public java.lang.Object getValue() throws SearchExceptionReturn the value for this cache entry.- Specified by:
getValuein interfaceResult- 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
-
basicGetValue
protected abstract java.lang.Object basicGetValue()
Get the actual value- Returns:
- value
-
getAttribute
public <T> T getAttribute(Attribute<T> attribute)
Retrieve the given attribute value for this cache entry- Specified by:
getAttributein interfaceResult- Parameters:
attribute- the attribute to retrieve- Returns:
- the attribute value, or null if there is none
-
basicGetAttribute
protected abstract java.lang.Object basicGetAttribute(java.lang.String name)
Get the actual attribute value- Returns:
- attribute
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-