Package net.sf.ehcache.search
Class Attribute<T>
- java.lang.Object
-
- net.sf.ehcache.search.Attribute<T>
-
- Type Parameters:
T- the parameterize type of this attribute
public class Attribute<T> extends java.lang.ObjectA search attribute. The main purpose of this class is to construct searchCriteriareferencing this attribute- Author:
- teck
-
-
Constructor Summary
Constructors Constructor Description Attribute(java.lang.String attributeName)Construct a new attribute instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Aggregatoraverage()Request an average value aggregation of this attributeCriteriabetween(T min, T max)Create a range criteria between the given min/max (inclusive).Criteriabetween(T min, T max, boolean minInclusive, boolean maxInclusive)Create a range criteria between the given min/max with specified inclusivenessAggregatorcount()Request a count aggregation of this attributeCriteriaeq(T value)Create a criteria where this attribute is equal to the given valuebooleanequals(java.lang.Object obj)Criteriage(T value)Create a criteria where this attribute is greater than or equal to the given valuejava.lang.StringgetAttributeName()Get the attribute nameCriteriagt(T value)Create a criteria where this attribute is greater than the given valueinthashCode()Criteriailike(java.lang.String regex)Create a criteria where this attribute's toString() matches the given expression SeeILikefor the expression syntaxCriteriain(java.util.Collection<? extends T> values)Create a criteria where this attribute is 'in' (ie.CriteriaisNull()Create a criteria that requires no value for this attributeCriteriale(T value)Create a criteria where this attribute is less than or equal to the given valueCriterialt(T value)Create a criteria where this attribute is less than the given valueAggregatormax()Request a maximum value aggregation of this attributeAggregatormin()Request a minimum value aggregation of this attributeCriteriane(T value)Create a criteria where this attribute is not equal to the given valueCriterianotIlike(java.lang.String regex)Create a criteria where this attribute's toString() does not match the given expression SeeILikefor the expression syntaxCriterianotNull()Create a criteria that accepts any non-null value for this attributeAggregatorsum()Request a sum aggregation of this attributejava.lang.StringtoString()
-
-
-
Constructor Detail
-
Attribute
public Attribute(java.lang.String attributeName)
Construct a new attribute instance. Instances are normally obtained from a specificCachehowever- Parameters:
attributeName- the name of search attribute
-
-
Method Detail
-
getAttributeName
public java.lang.String getAttributeName()
Get the attribute name- Returns:
- the attribute name
-
between
public Criteria between(T min, T max)
Create a range criteria between the given min/max (inclusive). This is the same as callingbetween(min, max, true, true)- Parameters:
min- the minimum value in the rangemax- the maximum value in the range- Returns:
- criteria instance
-
between
public Criteria between(T min, T max, boolean minInclusive, boolean maxInclusive)
Create a range criteria between the given min/max with specified inclusiveness- Parameters:
min- the minimum value in the rangemax- the maximum value in the rangeminInclusive- is the minimum inclusive in the rangemaxInclusive- is the maximum inclusive in the range- Returns:
- criteria instance
-
in
public Criteria in(java.util.Collection<? extends T> values)
Create a criteria where this attribute is 'in' (ie. contained within) the given collection of values. With the exception of very small collections aSetshould perform better here to get constant timecontains()checks- Parameters:
values-- Returns:
- criteria instance
-
ne
public Criteria ne(T value)
Create a criteria where this attribute is not equal to the given value- Parameters:
value-- Returns:
- criteria instance
-
lt
public Criteria lt(T value)
Create a criteria where this attribute is less than the given value- Parameters:
value-- Returns:
- criteria instance
-
le
public Criteria le(T value)
Create a criteria where this attribute is less than or equal to the given value- Parameters:
value-- Returns:
- criteria instance
-
gt
public Criteria gt(T value)
Create a criteria where this attribute is greater than the given value- Parameters:
value-- Returns:
- criteria instance
-
ge
public Criteria ge(T value)
Create a criteria where this attribute is greater than or equal to the given value- Parameters:
value-- Returns:
- criteria instance
-
eq
public Criteria eq(T value)
Create a criteria where this attribute is equal to the given value- Parameters:
value-- Returns:
- criteria instance
-
ilike
public Criteria ilike(java.lang.String regex)
Create a criteria where this attribute's toString() matches the given expression SeeILikefor the expression syntax- Parameters:
regex-- Returns:
- criteria instance
-
notIlike
public Criteria notIlike(java.lang.String regex)
Create a criteria where this attribute's toString() does not match the given expression SeeILikefor the expression syntax- Parameters:
regex-- Returns:
- criteria instance
-
isNull
public Criteria isNull()
Create a criteria that requires no value for this attribute- Returns:
- criteria instance
-
notNull
public Criteria notNull()
Create a criteria that accepts any non-null value for this attribute- Returns:
- criteria instance
-
count
public Aggregator count()
Request a count aggregation of this attribute- Returns:
- count aggregator
-
max
public Aggregator max()
Request a maximum value aggregation of this attribute- Returns:
- max aggregator
-
min
public Aggregator min()
Request a minimum value aggregation of this attribute- Returns:
- min aggregator
-
sum
public Aggregator sum()
Request a sum aggregation of this attribute- Returns:
- sum aggregator
-
average
public Aggregator average()
Request an average value aggregation of this attribute- Returns:
- average aggregator
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-