Class Conditions
- java.lang.Object
-
- io.tarantool.driver.api.conditions.Conditions
-
- All Implemented Interfaces:
Serializable
public final class Conditions extends Object implements Serializable
A collection and a builder for tuple filtering conditions. See https://github.com/tarantool/crud#select-conditions- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Conditions(Conditions conditions)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Conditionsafter(TarantoolTuple tuple)Start collecting tuples into result after the specified tuple.static <T> Conditionsafter(T tuple, ObjectConverter<T,org.msgpack.value.ArrayValue> tupleConverter)Start collecting tuples into result after the specified tuple.ConditionsandEquals(int fieldPosition, Object value)Filter tuples by the specified fieldConditionsandEquals(String fieldName, Object value)Filter tuples by the specified fieldConditionsandGreaterOrEquals(int fieldPosition, Object value)Filter tuples by the specified field, with values greater or equal than the specified valueConditionsandGreaterOrEquals(String fieldName, Object value)Filter tuples by the specified field, with values greater or equal than the specified valueConditionsandGreaterThan(int fieldPosition, Object value)Filter tuples by the specified field, with values greater than the specified valueConditionsandGreaterThan(String fieldName, Object value)Filter tuples by the specified field, with values greater than the specified valueConditionsandIndexEquals(int indexId, List<?> indexPartValues)Filter tuples by the specified indexConditionsandIndexEquals(String indexName, List<?> indexPartValues)Filter tuples by the specified indexConditionsandIndexGreaterOrEquals(int indexId, List<?> indexPartValues)Filter tuples by the specified index, with values greater or equal than the specified valueConditionsandIndexGreaterOrEquals(String indexName, List<?> indexPartValues)Filter tuples by the specified index, with values greater or equal than the specified valueConditionsandIndexGreaterThan(int indexId, List<?> indexPartValues)Filter tuples by the specified index, with values greater than the specified valueConditionsandIndexGreaterThan(String indexName, List<?> indexPartValues)Filter tuples by the specified index, with values greater than the specified valueConditionsandIndexLessOrEquals(int indexId, List<?> indexPartValues)Filter tuples by the specified index, with values less or equal than the specified valueConditionsandIndexLessOrEquals(String indexName, List<?> indexPartValues)Filter tuples by the specified index, with values less or equal than the specified valueConditionsandIndexLessThan(int indexId, List<?> indexPartValues)Filter tuples by the specified index, with values less than the specified valueConditionsandIndexLessThan(String indexName, List<?> indexPartValues)Filter tuples by the specified index, with values less than the specified valueConditionsandLessOrEquals(int fieldPosition, Object value)Filter tuples by the specified field, with values less or equal than the specified valueConditionsandLessOrEquals(String fieldName, Object value)Filter tuples by the specified field, with values less or equal than the specified valueConditionsandLessThan(int fieldPosition, Object value)Filter tuples by the specified field, with values less than the specified valueConditionsandLessThan(String fieldName, Object value)Filter tuples by the specified field, with values less than the specified valuestatic Conditionsany()Create new Conditions instance without any filtration.static Conditionsascending()Create new Conditions instance, returning tuples will in the ascending orderstatic Conditionsdescending()Create new Conditions instance, returning tuples in the descending orderstatic Conditionsequals(int fieldPosition, Object value)Filter tuples by the specified fieldbooleanequals(Object o)static Conditionsequals(String fieldName, Object value)Filter tuples by the specified fieldlonggetLimit()Get the specified limitlonggetOffset()Get the specified offsetPackablegetStartTuple()Get the specified index values to start fromstatic ConditionsgreaterOrEquals(int fieldPosition, Object value)Filter tuples by the specified field, with values greater or equal than the specified valuestatic ConditionsgreaterOrEquals(String fieldName, Object value)Filter tuples by the specified field, with values greater or equal than the specified valuestatic ConditionsgreaterThan(int fieldPosition, Object value)Filter tuples by the specified field, with values greater than the specified valuestatic ConditionsgreaterThan(String fieldName, Object value)Filter tuples by the specified field, with values greater than the specified valueinthashCode()static ConditionsindexEquals(int indexId, List<?> indexPartValues)Create new Conditions instance with filter by the specified indexstatic ConditionsindexEquals(String indexName, List<?> indexPartValues)Create new Conditions instance with filter by the specified indexstatic ConditionsindexGreaterOrEquals(int indexId, List<?> indexPartValues)Create new Conditions instance with filter by the specified index, with values greater or equal than the specified valuestatic ConditionsindexGreaterOrEquals(String indexName, List<?> indexPartValues)Create new Conditions instance with filter by the specified index, with values greater or equal than the specified valuestatic ConditionsindexGreaterThan(int indexId, List<?> indexPartValues)Create new Conditions instance with filter by the specified index, with values greater than the specified valuestatic ConditionsindexGreaterThan(String indexName, List<?> indexPartValues)Create new Conditions instance with filter by the specified index, with values greater than the specified valuestatic ConditionsindexLessOrEquals(int indexId, List<?> indexPartValues)Create new Conditions instance with filter by the specified index, with values less or equal than the specified valuestatic ConditionsindexLessOrEquals(String indexName, List<?> indexPartValues)Create new Conditions instance with filter by the specified index, with values less or equal than the specified valuestatic ConditionsindexLessThan(int indexId, List<?> indexPartValues)Create new Conditions instance with filter by the specified index, with values less than the specified valuestatic ConditionsindexLessThan(String indexName, List<?> indexPartValues)Create new Conditions instance with filter by the specified index, with values less than the specified valuebooleanisDescending()Get the descending option valuestatic ConditionslessOrEquals(int fieldPosition, Object value)Filter tuples by the specified field, with values less or equal than the specified valuestatic ConditionslessOrEquals(String fieldName, Object value)Filter tuples by the specified field, with values less or equal than the specified valuestatic ConditionslessThan(int fieldPosition, Object value)Filter tuples by the specified field, with values less than the specified valuestatic ConditionslessThan(String fieldName, Object value)Filter tuples by the specified field, with values less than the specified valuestatic Conditionslimit(long limit)Limit the number od returned tuples with the specified valuestatic Conditionsoffset(long offset)Skip the specified number of tuples before collecting the result.ConditionsstartAfter(TarantoolTuple tuple)Start collecting tuples into result after the specified tuple.<T> ConditionsstartAfter(T tuple, ObjectConverter<T,org.msgpack.value.ArrayValue> tupleConverter)Start collecting tuples into result after the specified tuple.TarantoolIndexQuerytoIndexQuery(TarantoolMetadataOperations operations, TarantoolSpaceMetadata spaceMetadata)List<?>toProxyQuery(TarantoolMetadataOperations operations, TarantoolSpaceMetadata spaceMetadata)ConditionswithAscending()Return tuples will in the ascending orderConditionswithDescending()Return tuples in the descending orderConditionswithLimit(long limit)Limit the number od returned tuples with the specified valueConditionswithOffset(long offset)Skip the specified number of tuples before collecting the result.
-
-
-
Constructor Detail
-
Conditions
public Conditions(Conditions conditions)
-
-
Method Detail
-
isDescending
public boolean isDescending()
Get the descending option value- Returns:
- false by default
-
descending
public static Conditions descending()
Create new Conditions instance, returning tuples in the descending order- Returns:
- new
Conditionsinstance
-
withDescending
public Conditions withDescending()
Return tuples in the descending order- Returns:
- this
Conditionsinstance
-
ascending
public static Conditions ascending()
Create new Conditions instance, returning tuples will in the ascending order- Returns:
- new
Conditionsinstance
-
withAscending
public Conditions withAscending()
Return tuples will in the ascending order- Returns:
- this
Conditionsinstance
-
any
public static Conditions any()
Create new Conditions instance without any filtration.- Returns:
- new
Conditionsinstance
-
limit
public static Conditions limit(long limit)
Limit the number od returned tuples with the specified value- Parameters:
limit- number of tuples, should be greater than 0- Returns:
- new
Conditionsinstance
-
withLimit
public Conditions withLimit(long limit)
Limit the number od returned tuples with the specified value- Parameters:
limit- number of tuples, should be greater than 0- Returns:
- this
Conditionsinstance
-
getLimit
public long getLimit()
Get the specified limit- Returns:
- number of tuples
-
offset
public static Conditions offset(long offset)
Skip the specified number of tuples before collecting the result.- Parameters:
offset- number of tuples, should be greater than 0- Returns:
- new
Conditionsinstance
-
withOffset
public Conditions withOffset(long offset)
Skip the specified number of tuples before collecting the result.- Parameters:
offset- number of tuples, should be greater than 0- Returns:
- this
Conditionsinstance
-
getOffset
public long getOffset()
Get the specified offset- Returns:
- number of tuples
-
after
public static Conditions after(TarantoolTuple tuple)
Start collecting tuples into result after the specified tuple. The tuple itself will not be added to the result.- Parameters:
tuple- last tuple value from the previous result, may be null- Returns:
- new
Conditionsinstance
-
after
public static <T> Conditions after(T tuple, ObjectConverter<T,org.msgpack.value.ArrayValue> tupleConverter)
Start collecting tuples into result after the specified tuple. The tuple itself will not be added to the result.- Type Parameters:
T- tuple type- Parameters:
tuple- last tuple value from the previous result, may be nulltupleConverter- converter of the specified tuple type into a MessagePack array- Returns:
- new
Conditionsinstance
-
startAfter
public Conditions startAfter(TarantoolTuple tuple)
Start collecting tuples into result after the specified tuple. The tuple itself will not be added to the result.- Parameters:
tuple- last tuple value from the previous result, may be null- Returns:
- new
Conditionsinstance
-
startAfter
public <T> Conditions startAfter(T tuple, ObjectConverter<T,org.msgpack.value.ArrayValue> tupleConverter)
Start collecting tuples into result after the specified tuple. The tuple itself will not be added to the result.- Type Parameters:
T- tuple type- Parameters:
tuple- last tuple value from the previous result, may be nulltupleConverter- converter of the specified tuple type into a MessagePack array- Returns:
- new
Conditionsinstance
-
getStartTuple
public Packable getStartTuple()
Get the specified index values to start from- Returns:
- list of index parts values
-
indexEquals
public static Conditions indexEquals(String indexName, List<?> indexPartValues)
Create new Conditions instance with filter by the specified index- Parameters:
indexName- index nameindexPartValues- index parts values- Returns:
- new
Conditionsinstance
-
andIndexEquals
public Conditions andIndexEquals(String indexName, List<?> indexPartValues)
Filter tuples by the specified index- Parameters:
indexName- index nameindexPartValues- index parts values- Returns:
- new
Conditionsinstance
-
indexEquals
public static Conditions indexEquals(int indexId, List<?> indexPartValues)
Create new Conditions instance with filter by the specified index- Parameters:
indexId- index idindexPartValues- index parts values- Returns:
- new
Conditionsinstance
-
andIndexEquals
public Conditions andIndexEquals(int indexId, List<?> indexPartValues)
Filter tuples by the specified index- Parameters:
indexId- index idindexPartValues- index parts values- Returns:
- this
Conditionsinstance
-
indexGreaterThan
public static Conditions indexGreaterThan(String indexName, List<?> indexPartValues)
Create new Conditions instance with filter by the specified index, with values greater than the specified value- Parameters:
indexName- index nameindexPartValues- index parts values- Returns:
- new
Conditionsinstance
-
andIndexGreaterThan
public Conditions andIndexGreaterThan(String indexName, List<?> indexPartValues)
Filter tuples by the specified index, with values greater than the specified value- Parameters:
indexName- index nameindexPartValues- index parts values- Returns:
- new
Conditionsinstance
-
indexGreaterThan
public static Conditions indexGreaterThan(int indexId, List<?> indexPartValues)
Create new Conditions instance with filter by the specified index, with values greater than the specified value- Parameters:
indexId- index idindexPartValues- index parts values- Returns:
- new
Conditionsinstance
-
andIndexGreaterThan
public Conditions andIndexGreaterThan(int indexId, List<?> indexPartValues)
Filter tuples by the specified index, with values greater than the specified value- Parameters:
indexId- index idindexPartValues- index parts values- Returns:
- this
Conditionsinstance
-
indexGreaterOrEquals
public static Conditions indexGreaterOrEquals(String indexName, List<?> indexPartValues)
Create new Conditions instance with filter by the specified index, with values greater or equal than the specified value- Parameters:
indexName- index nameindexPartValues- index parts values- Returns:
- new
Conditionsinstance
-
andIndexGreaterOrEquals
public Conditions andIndexGreaterOrEquals(String indexName, List<?> indexPartValues)
Filter tuples by the specified index, with values greater or equal than the specified value- Parameters:
indexName- index nameindexPartValues- index parts values- Returns:
- new
Conditionsinstance
-
indexGreaterOrEquals
public static Conditions indexGreaterOrEquals(int indexId, List<?> indexPartValues)
Create new Conditions instance with filter by the specified index, with values greater or equal than the specified value- Parameters:
indexId- index idindexPartValues- index parts values- Returns:
- new
Conditionsinstance
-
andIndexGreaterOrEquals
public Conditions andIndexGreaterOrEquals(int indexId, List<?> indexPartValues)
Filter tuples by the specified index, with values greater or equal than the specified value- Parameters:
indexId- index idindexPartValues- index parts values- Returns:
- this
Conditionsinstance
-
indexLessThan
public static Conditions indexLessThan(String indexName, List<?> indexPartValues)
Create new Conditions instance with filter by the specified index, with values less than the specified value- Parameters:
indexName- index nameindexPartValues- index parts values- Returns:
- new
Conditionsinstance
-
andIndexLessThan
public Conditions andIndexLessThan(String indexName, List<?> indexPartValues)
Filter tuples by the specified index, with values less than the specified value- Parameters:
indexName- index nameindexPartValues- index parts values- Returns:
- new
Conditionsinstance
-
indexLessThan
public static Conditions indexLessThan(int indexId, List<?> indexPartValues)
Create new Conditions instance with filter by the specified index, with values less than the specified value- Parameters:
indexId- index idindexPartValues- index parts values- Returns:
- new
Conditionsinstance
-
andIndexLessThan
public Conditions andIndexLessThan(int indexId, List<?> indexPartValues)
Filter tuples by the specified index, with values less than the specified value- Parameters:
indexId- index idindexPartValues- index parts values- Returns:
- this
Conditionsinstance
-
indexLessOrEquals
public static Conditions indexLessOrEquals(String indexName, List<?> indexPartValues)
Create new Conditions instance with filter by the specified index, with values less or equal than the specified value- Parameters:
indexName- index nameindexPartValues- index parts values- Returns:
- new
Conditionsinstance
-
andIndexLessOrEquals
public Conditions andIndexLessOrEquals(String indexName, List<?> indexPartValues)
Filter tuples by the specified index, with values less or equal than the specified value- Parameters:
indexName- index nameindexPartValues- index parts values- Returns:
- new
Conditionsinstance
-
indexLessOrEquals
public static Conditions indexLessOrEquals(int indexId, List<?> indexPartValues)
Create new Conditions instance with filter by the specified index, with values less or equal than the specified value- Parameters:
indexId- index idindexPartValues- index parts values- Returns:
- new
Conditionsinstance
-
andIndexLessOrEquals
public Conditions andIndexLessOrEquals(int indexId, List<?> indexPartValues)
Filter tuples by the specified index, with values less or equal than the specified value- Parameters:
indexId- index idindexPartValues- index parts values- Returns:
- this
Conditionsinstance
-
equals
public static Conditions equals(String fieldName, Object value)
Filter tuples by the specified field- Parameters:
fieldName- field namevalue- field value- Returns:
- new
Conditionsinstance
-
andEquals
public Conditions andEquals(String fieldName, Object value)
Filter tuples by the specified field- Parameters:
fieldName- field namevalue- field value- Returns:
- this
Conditionsinstance
-
equals
public static Conditions equals(int fieldPosition, Object value)
Filter tuples by the specified field- Parameters:
fieldPosition- field positionvalue- field value- Returns:
- new
Conditionsinstance
-
andEquals
public Conditions andEquals(int fieldPosition, Object value)
Filter tuples by the specified field- Parameters:
fieldPosition- field positionvalue- field value- Returns:
- this
Conditionsinstance
-
greaterThan
public static Conditions greaterThan(String fieldName, Object value)
Filter tuples by the specified field, with values greater than the specified value- Parameters:
fieldName- field namevalue- field value- Returns:
- new
Conditionsinstance
-
andGreaterThan
public Conditions andGreaterThan(String fieldName, Object value)
Filter tuples by the specified field, with values greater than the specified value- Parameters:
fieldName- field namevalue- field value- Returns:
- this
Conditionsinstance
-
greaterThan
public static Conditions greaterThan(int fieldPosition, Object value)
Filter tuples by the specified field, with values greater than the specified value- Parameters:
fieldPosition- field positionvalue- field value- Returns:
- new
Conditionsinstance
-
andGreaterThan
public Conditions andGreaterThan(int fieldPosition, Object value)
Filter tuples by the specified field, with values greater than the specified value- Parameters:
fieldPosition- field positionvalue- field value- Returns:
- this
Conditionsinstance
-
greaterOrEquals
public static Conditions greaterOrEquals(String fieldName, Object value)
Filter tuples by the specified field, with values greater or equal than the specified value- Parameters:
fieldName- field namevalue- field value- Returns:
- new
Conditionsinstance
-
andGreaterOrEquals
public Conditions andGreaterOrEquals(String fieldName, Object value)
Filter tuples by the specified field, with values greater or equal than the specified value- Parameters:
fieldName- field namevalue- field value- Returns:
- this
Conditionsinstance
-
greaterOrEquals
public static Conditions greaterOrEquals(int fieldPosition, Object value)
Filter tuples by the specified field, with values greater or equal than the specified value- Parameters:
fieldPosition- field positionvalue- field value- Returns:
- new
Conditionsinstance
-
andGreaterOrEquals
public Conditions andGreaterOrEquals(int fieldPosition, Object value)
Filter tuples by the specified field, with values greater or equal than the specified value- Parameters:
fieldPosition- field positionvalue- field value- Returns:
- this
Conditionsinstance
-
lessThan
public static Conditions lessThan(String fieldName, Object value)
Filter tuples by the specified field, with values less than the specified value- Parameters:
fieldName- field namevalue- field value- Returns:
- new
Conditionsinstance
-
andLessThan
public Conditions andLessThan(String fieldName, Object value)
Filter tuples by the specified field, with values less than the specified value- Parameters:
fieldName- field namevalue- field value- Returns:
- this
Conditionsinstance
-
lessThan
public static Conditions lessThan(int fieldPosition, Object value)
Filter tuples by the specified field, with values less than the specified value- Parameters:
fieldPosition- field positionvalue- field value- Returns:
- new
Conditionsinstance
-
andLessThan
public Conditions andLessThan(int fieldPosition, Object value)
Filter tuples by the specified field, with values less than the specified value- Parameters:
fieldPosition- field positionvalue- field value- Returns:
- this
Conditionsinstance
-
lessOrEquals
public static Conditions lessOrEquals(String fieldName, Object value)
Filter tuples by the specified field, with values less or equal than the specified value- Parameters:
fieldName- field namevalue- field value- Returns:
- new
Conditionsinstance
-
andLessOrEquals
public Conditions andLessOrEquals(String fieldName, Object value)
Filter tuples by the specified field, with values less or equal than the specified value- Parameters:
fieldName- field namevalue- field value- Returns:
- this
Conditionsinstance
-
lessOrEquals
public static Conditions lessOrEquals(int fieldPosition, Object value)
Filter tuples by the specified field, with values less or equal than the specified value- Parameters:
fieldPosition- field positionvalue- field value- Returns:
- new
Conditionsinstance
-
andLessOrEquals
public Conditions andLessOrEquals(int fieldPosition, Object value)
Filter tuples by the specified field, with values less or equal than the specified value- Parameters:
fieldPosition- field positionvalue- field value- Returns:
- this
Conditionsinstance
-
toProxyQuery
public List<?> toProxyQuery(TarantoolMetadataOperations operations, TarantoolSpaceMetadata spaceMetadata)
-
toIndexQuery
public TarantoolIndexQuery toIndexQuery(TarantoolMetadataOperations operations, TarantoolSpaceMetadata spaceMetadata)
-
-