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 Conditions
after(TarantoolTuple tuple)
Start collecting tuples into result after the specified tuple.static <T> Conditions
after(T tuple, ObjectConverter<T,org.msgpack.value.ArrayValue> tupleConverter)
Start collecting tuples into result after the specified tuple.Conditions
andEquals(int fieldPosition, Object value)
Filter tuples by the specified fieldConditions
andEquals(String fieldName, Object value)
Filter tuples by the specified fieldConditions
andGreaterOrEquals(int fieldPosition, Object value)
Filter tuples by the specified field, with values greater or equal than the specified valueConditions
andGreaterOrEquals(String fieldName, Object value)
Filter tuples by the specified field, with values greater or equal than the specified valueConditions
andGreaterThan(int fieldPosition, Object value)
Filter tuples by the specified field, with values greater than the specified valueConditions
andGreaterThan(String fieldName, Object value)
Filter tuples by the specified field, with values greater than the specified valueConditions
andIndexEquals(int indexId, List<?> indexPartValues)
Filter tuples by the specified indexConditions
andIndexEquals(String indexName, List<?> indexPartValues)
Filter tuples by the specified indexConditions
andIndexGreaterOrEquals(int indexId, List<?> indexPartValues)
Filter tuples by the specified index, with values greater or equal than the specified valueConditions
andIndexGreaterOrEquals(String indexName, List<?> indexPartValues)
Filter tuples by the specified index, with values greater or equal than the specified valueConditions
andIndexGreaterThan(int indexId, List<?> indexPartValues)
Filter tuples by the specified index, with values greater than the specified valueConditions
andIndexGreaterThan(String indexName, List<?> indexPartValues)
Filter tuples by the specified index, with values greater than the specified valueConditions
andIndexLessOrEquals(int indexId, List<?> indexPartValues)
Filter tuples by the specified index, with values less or equal than the specified valueConditions
andIndexLessOrEquals(String indexName, List<?> indexPartValues)
Filter tuples by the specified index, with values less or equal than the specified valueConditions
andIndexLessThan(int indexId, List<?> indexPartValues)
Filter tuples by the specified index, with values less than the specified valueConditions
andIndexLessThan(String indexName, List<?> indexPartValues)
Filter tuples by the specified index, with values less than the specified valueConditions
andLessOrEquals(int fieldPosition, Object value)
Filter tuples by the specified field, with values less or equal than the specified valueConditions
andLessOrEquals(String fieldName, Object value)
Filter tuples by the specified field, with values less or equal than the specified valueConditions
andLessThan(int fieldPosition, Object value)
Filter tuples by the specified field, with values less than the specified valueConditions
andLessThan(String fieldName, Object value)
Filter tuples by the specified field, with values less than the specified valuestatic Conditions
any()
Create new Conditions instance without any filtration.static Conditions
ascending()
Create new Conditions instance, returning tuples will in the ascending orderstatic Conditions
descending()
Create new Conditions instance, returning tuples in the descending orderstatic Conditions
equals(int fieldPosition, Object value)
Filter tuples by the specified fieldboolean
equals(Object o)
static Conditions
equals(String fieldName, Object value)
Filter tuples by the specified fieldlong
getLimit()
Get the specified limitlong
getOffset()
Get the specified offsetPackable
getStartTuple()
Get the specified index values to start fromstatic Conditions
greaterOrEquals(int fieldPosition, Object value)
Filter tuples by the specified field, with values greater or equal than the specified valuestatic Conditions
greaterOrEquals(String fieldName, Object value)
Filter tuples by the specified field, with values greater or equal than the specified valuestatic Conditions
greaterThan(int fieldPosition, Object value)
Filter tuples by the specified field, with values greater than the specified valuestatic Conditions
greaterThan(String fieldName, Object value)
Filter tuples by the specified field, with values greater than the specified valueint
hashCode()
static Conditions
indexEquals(int indexId, List<?> indexPartValues)
Create new Conditions instance with filter by the specified indexstatic Conditions
indexEquals(String indexName, List<?> indexPartValues)
Create new Conditions instance with filter by the specified indexstatic Conditions
indexGreaterOrEquals(int indexId, List<?> indexPartValues)
Create new Conditions instance with filter by the specified index, with values greater or equal than the specified valuestatic Conditions
indexGreaterOrEquals(String indexName, List<?> indexPartValues)
Create new Conditions instance with filter by the specified index, with values greater or equal than the specified valuestatic Conditions
indexGreaterThan(int indexId, List<?> indexPartValues)
Create new Conditions instance with filter by the specified index, with values greater than the specified valuestatic Conditions
indexGreaterThan(String indexName, List<?> indexPartValues)
Create new Conditions instance with filter by the specified index, with values greater than the specified valuestatic Conditions
indexLessOrEquals(int indexId, List<?> indexPartValues)
Create new Conditions instance with filter by the specified index, with values less or equal than the specified valuestatic Conditions
indexLessOrEquals(String indexName, List<?> indexPartValues)
Create new Conditions instance with filter by the specified index, with values less or equal than the specified valuestatic Conditions
indexLessThan(int indexId, List<?> indexPartValues)
Create new Conditions instance with filter by the specified index, with values less than the specified valuestatic Conditions
indexLessThan(String indexName, List<?> indexPartValues)
Create new Conditions instance with filter by the specified index, with values less than the specified valueboolean
isDescending()
Get the descending option valuestatic Conditions
lessOrEquals(int fieldPosition, Object value)
Filter tuples by the specified field, with values less or equal than the specified valuestatic Conditions
lessOrEquals(String fieldName, Object value)
Filter tuples by the specified field, with values less or equal than the specified valuestatic Conditions
lessThan(int fieldPosition, Object value)
Filter tuples by the specified field, with values less than the specified valuestatic Conditions
lessThan(String fieldName, Object value)
Filter tuples by the specified field, with values less than the specified valuestatic Conditions
limit(long limit)
Limit the number od returned tuples with the specified valuestatic Conditions
offset(long offset)
Skip the specified number of tuples before collecting the result.Conditions
startAfter(TarantoolTuple tuple)
Start collecting tuples into result after the specified tuple.<T> Conditions
startAfter(T tuple, ObjectConverter<T,org.msgpack.value.ArrayValue> tupleConverter)
Start collecting tuples into result after the specified tuple.TarantoolIndexQuery
toIndexQuery(TarantoolMetadataOperations operations, TarantoolSpaceMetadata spaceMetadata)
List<?>
toProxyQuery(TarantoolMetadataOperations operations, TarantoolSpaceMetadata spaceMetadata)
Conditions
withAscending()
Return tuples will in the ascending orderConditions
withDescending()
Return tuples in the descending orderConditions
withLimit(long limit)
Limit the number od returned tuples with the specified valueConditions
withOffset(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
Conditions
instance
-
withDescending
public Conditions withDescending()
Return tuples in the descending order- Returns:
- this
Conditions
instance
-
ascending
public static Conditions ascending()
Create new Conditions instance, returning tuples will in the ascending order- Returns:
- new
Conditions
instance
-
withAscending
public Conditions withAscending()
Return tuples will in the ascending order- Returns:
- this
Conditions
instance
-
any
public static Conditions any()
Create new Conditions instance without any filtration.- Returns:
- new
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
andIndexEquals
public Conditions andIndexEquals(String indexName, List<?> indexPartValues)
Filter tuples by the specified index- Parameters:
indexName
- index nameindexPartValues
- index parts values- Returns:
- new
Conditions
instance
-
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
Conditions
instance
-
andIndexEquals
public Conditions andIndexEquals(int indexId, List<?> indexPartValues)
Filter tuples by the specified index- Parameters:
indexId
- index idindexPartValues
- index parts values- Returns:
- this
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
equals
public static Conditions equals(String fieldName, Object value)
Filter tuples by the specified field- Parameters:
fieldName
- field namevalue
- field value- Returns:
- new
Conditions
instance
-
andEquals
public Conditions andEquals(String fieldName, Object value)
Filter tuples by the specified field- Parameters:
fieldName
- field namevalue
- field value- Returns:
- this
Conditions
instance
-
equals
public static Conditions equals(int fieldPosition, Object value)
Filter tuples by the specified field- Parameters:
fieldPosition
- field positionvalue
- field value- Returns:
- new
Conditions
instance
-
andEquals
public Conditions andEquals(int fieldPosition, Object value)
Filter tuples by the specified field- Parameters:
fieldPosition
- field positionvalue
- field value- Returns:
- this
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
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
Conditions
instance
-
toProxyQuery
public List<?> toProxyQuery(TarantoolMetadataOperations operations, TarantoolSpaceMetadata spaceMetadata)
-
toIndexQuery
public TarantoolIndexQuery toIndexQuery(TarantoolMetadataOperations operations, TarantoolSpaceMetadata spaceMetadata)
-
-