org.terracotta.toolkit.search
Class Attribute<T>

java.lang.Object
  extended by org.terracotta.toolkit.search.Attribute<T>

public class Attribute<T>
extends Object

Represents search attribute


Constructor Summary
Attribute(String attributeName)
          Construct a new attribute instance
 
Method Summary
 AggregateFunction average()
          Request an average value aggregation of this attribute
 AggregateFunction count()
          Request a count aggregation of this attribute
 Clause eq(T value)
          Create a clause where this attribute is equal to the given value
 boolean equals(Object obj)
          
 Clause exists()
          Create a clause that tests for presence of value for this attribute
 Clause ge(T value)
          Create a clause where this attribute is greater than or equal to the given value
 String getAttributeName()
          Get the attribute name
 Clause gt(T value)
          Create a clause where this attribute is greater than the given value
 int hashCode()
          
 Clause le(T value)
          Create a clause where this attribute is less than or equal to the given value
 Clause lt(T value)
          Create a clause where this attribute is less than the given value
 Clause matches(String regex)
          Create a clause where this attribute's toString() matches the given expression See Matches for the expression syntax
 AggregateFunction max()
          Request a maximum value aggregation of this attribute
 AggregateFunction min()
          Request a minimum value aggregation of this attribute
 Clause ne(T value)
          Create a clause where this attribute is not equal to the given value
 Clause oneOf(Collection<? extends T> values)
          Create a clause where the value of this attribute must be one of the given values.
 Clause range(T min, T max)
          Create a range search clause between the given min/max (inclusive).
 Clause range(T min, T max, boolean minInclusive, boolean maxInclusive)
          Create a range clause between the given min/max with specified inclusiveness
 AggregateFunction sum()
          Request a sum aggregation of this attribute
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Attribute

public Attribute(String attributeName)
Construct a new attribute instance

Parameters:
attributeName - the name of search attribute
Method Detail

getAttributeName

public String getAttributeName()
Get the attribute name

Returns:
the attribute name

range

public Clause range(T min,
                    T max)
Create a range search clause between the given min/max (inclusive). This is the same as calling between(min, max, true, true)

Parameters:
min - the minimum value in the range
max - the maximum value in the range
Returns:
clause instance

range

public Clause range(T min,
                    T max,
                    boolean minInclusive,
                    boolean maxInclusive)
Create a range clause between the given min/max with specified inclusiveness

Parameters:
min - the minimum value in the range
max - the maximum value in the range
minInclusive - is the minimum inclusive in the range
maxInclusive - is the maximum inclusive in the range
Returns:
clause instance

oneOf

public Clause oneOf(Collection<? extends T> values)
Create a clause where the value of this attribute must be one of the given values.

Parameters:
values -
Returns:
clause instance

ne

public Clause ne(T value)
Create a clause where this attribute is not equal to the given value

Parameters:
value -
Returns:
clause instance

lt

public Clause lt(T value)
Create a clause where this attribute is less than the given value

Parameters:
value -
Returns:
clause instance

le

public Clause le(T value)
Create a clause where this attribute is less than or equal to the given value

Parameters:
value -
Returns:
clause instance

gt

public Clause gt(T value)
Create a clause where this attribute is greater than the given value

Parameters:
value -
Returns:
clause instance

ge

public Clause ge(T value)
Create a clause where this attribute is greater than or equal to the given value

Parameters:
value -
Returns:
clause instance

eq

public Clause eq(T value)
Create a clause where this attribute is equal to the given value

Parameters:
value -
Returns:
clause instance

exists

public Clause exists()
Create a clause that tests for presence of value for this attribute


matches

public Clause matches(String regex)
Create a clause where this attribute's toString() matches the given expression See Matches for the expression syntax

Parameters:
regex -
Returns:
clause instance

count

public AggregateFunction count()
Request a count aggregation of this attribute

Returns:
count aggregator

max

public AggregateFunction max()
Request a maximum value aggregation of this attribute

Returns:
max aggregator

min

public AggregateFunction min()
Request a minimum value aggregation of this attribute

Returns:
min aggregator

sum

public AggregateFunction sum()
Request a sum aggregation of this attribute

Returns:
sum aggregator

average

public AggregateFunction average()
Request an average value aggregation of this attribute

Returns:
average aggregator

toString

public String toString()

Overrides:
toString in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)

Overrides:
equals in class Object


Copyright © 2014 Terracotta, Inc.. All Rights Reserved.