Package jakarta.nosql.column
Interface ColumnCondition
-
public interface ColumnCondition
An unit condition to run a column family select- See Also:
ColumnFamilyManager.select(ColumnQuery)
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
ColumnCondition.ColumnConditionProvider
A Supplier ofColumnCondition
where it will create from two parameters: The first one isColumn
The second one is the Condition
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description ColumnCondition
and(ColumnCondition condition)
Creates a newColumnCondition
using theCondition.AND
static ColumnCondition
and(ColumnCondition... conditions)
Returns a newColumnCondition
aggregating ,as ¨AND", all the conditions as just one condition.static ColumnCondition
between(Column column)
Creates aColumnCondition
that has aCondition.BETWEEN
, it means a select will scanning to a column family that is between two values informed on a column name.static ColumnCondition
eq(Column column)
Creates aColumnCondition
that has aCondition.EQUALS
, it means a select will scanning to a column family that has the same name and equals value informed in this column.Column
getColumn()
Gets the column to be used in the selectCondition
getCondition()
Gets the conditions to be used in the selectstatic ColumnCondition
gt(Column column)
Creates aColumnCondition
that has aCondition.GREATER_THAN
, it means a select will scanning to a column family that has the same name and the value greater than informed in this column.static ColumnCondition
gte(Column column)
Creates aColumnCondition
that has aCondition.GREATER_EQUALS_THAN
, it means a select will scanning to a column family that has the same name and the value greater or equals than informed in this column.static ColumnCondition
in(Column column)
Creates aColumnCondition
that has aCondition.IN
, it means a select will scanning to a column family that has the same name and the value is within informed in this column.static ColumnCondition
like(Column column)
Creates aColumnCondition
that has aCondition.LIKE
, it means a select will scanning to a column family that has the same name and the value is like than informed in this column.static ColumnCondition
lt(Column column)
Creates aColumnCondition
that has aCondition.LESSER_THAN
, it means a select will scanning to a column family that has the same name and the value lesser than informed in this column.static ColumnCondition
lte(Column column)
Creates aColumnCondition
that has aCondition.LESSER_EQUALS_THAN
, it means a select will scanning to a column family that has the same name and the value lesser or equals than informed in this column.ColumnCondition
negate()
Creates a newColumnCondition
negating the current oneColumnCondition
or(ColumnCondition condition)
Creates a newColumnCondition
using theCondition.OR
static ColumnCondition
or(ColumnCondition... conditions)
Returns a newColumnCondition
aggregating ,as ¨OR", all the conditions as just one condition.
-
-
-
Method Detail
-
getColumn
Column getColumn()
Gets the column to be used in the select- Returns:
- a column instance
-
getCondition
Condition getCondition()
Gets the conditions to be used in the select- Returns:
- a Condition instance
- See Also:
Condition
-
and
ColumnCondition and(ColumnCondition condition)
Creates a newColumnCondition
using theCondition.AND
- Parameters:
condition
- the condition to be agregated- Returns:
- the conditions joined as AND
- Throws:
NullPointerException
- when the condition is null
-
negate
ColumnCondition negate()
Creates a newColumnCondition
negating the current one- Returns:
- the negated condition
- See Also:
Condition.NOT
-
or
ColumnCondition or(ColumnCondition condition)
Creates a newColumnCondition
using theCondition.OR
- Parameters:
condition
- the condition to be agregated- Returns:
- the conditions joined as AND
- Throws:
NullPointerException
- when the condition is null
-
eq
static ColumnCondition eq(Column column)
Creates aColumnCondition
that has aCondition.EQUALS
, it means a select will scanning to a column family that has the same name and equals value informed in this column.- Parameters:
column
- a column instance- Returns:
- a
ColumnCondition
withCondition.EQUALS
- Throws:
NullPointerException
- when column is null
-
gt
static ColumnCondition gt(Column column)
Creates aColumnCondition
that has aCondition.GREATER_THAN
, it means a select will scanning to a column family that has the same name and the value greater than informed in this column.- Parameters:
column
- a column instance- Returns:
- a
ColumnCondition
withCondition.GREATER_THAN
- Throws:
NullPointerException
- when column is null
-
gte
static ColumnCondition gte(Column column)
Creates aColumnCondition
that has aCondition.GREATER_EQUALS_THAN
, it means a select will scanning to a column family that has the same name and the value greater or equals than informed in this column.- Parameters:
column
- a column instance- Returns:
- a
ColumnCondition
withCondition.GREATER_EQUALS_THAN
- Throws:
NullPointerException
- when column is null
-
lt
static ColumnCondition lt(Column column)
Creates aColumnCondition
that has aCondition.LESSER_THAN
, it means a select will scanning to a column family that has the same name and the value lesser than informed in this column.- Parameters:
column
- a column instance- Returns:
- a
ColumnCondition
withCondition.LESSER_THAN
- Throws:
NullPointerException
- when column is null
-
lte
static ColumnCondition lte(Column column)
Creates aColumnCondition
that has aCondition.LESSER_EQUALS_THAN
, it means a select will scanning to a column family that has the same name and the value lesser or equals than informed in this column.- Parameters:
column
- a column instance- Returns:
- a
ColumnCondition
withCondition.LESSER_EQUALS_THAN
- Throws:
NullPointerException
- when column is null
-
in
static ColumnCondition in(Column column)
Creates aColumnCondition
that has aCondition.IN
, it means a select will scanning to a column family that has the same name and the value is within informed in this column.- Parameters:
column
- a column instance- Returns:
- a
ColumnCondition
withCondition.IN
- Throws:
NullPointerException
- when column is nullIllegalArgumentException
- when theColumn.get()
in not an iterable implementation
-
like
static ColumnCondition like(Column column)
Creates aColumnCondition
that has aCondition.LIKE
, it means a select will scanning to a column family that has the same name and the value is like than informed in this column.- Parameters:
column
- a column instance- Returns:
- a
ColumnCondition
withCondition.LIKE
- Throws:
NullPointerException
- when column is null
-
between
static ColumnCondition between(Column column)
Creates aColumnCondition
that has aCondition.BETWEEN
, it means a select will scanning to a column family that is between two values informed on a column name. The column must have aColumn.get()
anIterable
implementation with just two elements.- Parameters:
column
- a column instance- Returns:
- The between condition
- Throws:
NullPointerException
- when column is nullIllegalArgumentException
- When the column neither has an Iterable instance or two elements on an Iterable.
-
and
static ColumnCondition and(ColumnCondition... conditions)
Returns a newColumnCondition
aggregating ,as ¨AND", all the conditions as just one condition. TheColumn
will storage theCondition.getNameField()
as key and the value gonna be theList
of all conditions, in other words.Given:
Column age = Column.of("age", 26); Column name = Column.of("name", "otavio"); ColumnCondition condition = ColumnCondition.eq(name).and(ColumnCondition.gte(age));
ThegetColumn()
will have "_AND" as key and the list of condition as value.- Parameters:
conditions
- the conditions to be aggregated- Returns:
- the new
ColumnCondition
instance - Throws:
NullPointerException
- when the conditions is null
-
or
static ColumnCondition or(ColumnCondition... conditions)
Returns a newColumnCondition
aggregating ,as ¨OR", all the conditions as just one condition. TheColumn
will storage theCondition.getNameField()
as key and the value gonna be theList
of all conditions, in other words.Given:
Column age = Column.of("age", 26); Column name = Column.of("name", "otavio"); ColumnCondition condition = ColumnCondition.eq(name).or(ColumnCondition.gte(age));
ThegetColumn()
will have "_OR" as key and the list of condition as value.- Parameters:
conditions
- the conditions to be aggregated- Returns:
- the new
ColumnCondition
instance - Throws:
NullPointerException
- when the condition is null
-
-