public final class Filters
extends java.lang.Object
Filter
instances.
Public methods of this class represent the recommended way to create
a Filter
.
The filters support two generic kinds of comparison:
The equality comparison supports any data type for the compared objects.
The ordering comparison (>
, <
, >=
,
<=
) supports only the following types:
com.google.protobuf.Timestamp
;
io.spine.core.Version
;
String
.
for the application
,
QueryFilter
,
EntityStateFilter
,
EventFilter
Modifier and Type | Method and Description |
---|---|
static io.spine.client.CompositeFilter |
all(io.spine.client.Filter first,
io.spine.client.Filter... rest)
Creates a new conjunction composite filter.
|
static io.spine.client.CompositeFilter |
either(io.spine.client.Filter first,
io.spine.client.Filter... rest)
Creates a new disjunction composite filter.
|
static io.spine.client.Filter |
eq(io.spine.base.EntityColumn column,
java.lang.Object value)
Creates a new equality
Filter . |
static io.spine.client.Filter |
eq(io.spine.base.EntityStateField field,
java.lang.Object value)
Creates a new equality
Filter . |
static io.spine.client.Filter |
eq(io.spine.core.EventContextField field,
java.lang.Object value)
Creates a new equality
Filter . |
static io.spine.client.Filter |
eq(io.spine.base.EventMessageField field,
java.lang.Object value)
Creates a new equality
Filter . |
static io.spine.client.Filter |
eq(java.lang.String fieldPath,
java.lang.Object value)
Creates a new equality
Filter . |
static io.spine.client.Filter |
ge(io.spine.base.EntityColumn column,
java.lang.Object value)
Creates a new "greater or equal"
Filter . |
static io.spine.client.Filter |
ge(io.spine.base.EntityStateField field,
java.lang.Object value)
Creates a new "greater or equal"
Filter . |
static io.spine.client.Filter |
ge(io.spine.core.EventContextField field,
java.lang.Object value)
Creates a new "greater or equal"
Filter . |
static io.spine.client.Filter |
ge(io.spine.base.EventMessageField field,
java.lang.Object value)
Creates a new "greater or equal"
Filter . |
static io.spine.client.Filter |
ge(java.lang.String fieldPath,
java.lang.Object value)
Creates a new "greater or equal"
Filter . |
static io.spine.client.Filter |
gt(io.spine.base.EntityColumn column,
java.lang.Object value)
Creates a new "greater than"
Filter . |
static io.spine.client.Filter |
gt(io.spine.base.EntityStateField field,
java.lang.Object value)
Creates a new "greater than"
Filter . |
static io.spine.client.Filter |
gt(io.spine.core.EventContextField field,
java.lang.Object value)
Creates a new "greater than"
Filter . |
static io.spine.client.Filter |
gt(io.spine.base.EventMessageField field,
java.lang.Object value)
Creates a new "greater than"
Filter . |
static io.spine.client.Filter |
gt(java.lang.String fieldPath,
java.lang.Object value)
Creates a new "greater than"
Filter . |
static io.spine.client.Filter |
le(io.spine.base.EntityColumn column,
java.lang.Object value)
Creates a new "less or equal"
Filter . |
static io.spine.client.Filter |
le(io.spine.base.EntityStateField field,
java.lang.Object value)
Creates a new "less or equal"
Filter . |
static io.spine.client.Filter |
le(io.spine.core.EventContextField field,
java.lang.Object value)
Creates a new "less or equal"
Filter . |
static io.spine.client.Filter |
le(io.spine.base.EventMessageField field,
java.lang.Object value)
Creates a new "less or equal"
Filter . |
static io.spine.client.Filter |
le(java.lang.String fieldPath,
java.lang.Object value)
Creates a new "less or equal"
Filter . |
static io.spine.client.Filter |
lt(io.spine.base.EntityColumn column,
java.lang.Object value)
Creates a new "less than"
Filter . |
static io.spine.client.Filter |
lt(io.spine.base.EntityStateField field,
java.lang.Object value)
Creates a new "less than"
Filter . |
static io.spine.client.Filter |
lt(io.spine.core.EventContextField field,
java.lang.Object value)
Creates a new "less than"
Filter . |
static io.spine.client.Filter |
lt(io.spine.base.EventMessageField field,
java.lang.Object value)
Creates a new "less than"
Filter . |
static io.spine.client.Filter |
lt(java.lang.String fieldPath,
java.lang.Object value)
Creates a new "less than"
Filter . |
public static io.spine.client.Filter eq(java.lang.String fieldPath, java.lang.Object value)
Filter
.fieldPath
- the field path or the entity column name for entity filtersvalue
- the requested valueFilter
public static io.spine.client.Filter eq(io.spine.base.EntityColumn column, java.lang.Object value)
Filter
.column
- the entity column to filter byvalue
- the requested valueFilter
public static io.spine.client.Filter eq(io.spine.base.EntityStateField field, java.lang.Object value)
Filter
.field
- the entity state field to filter byvalue
- the requested valueFilter
public static io.spine.client.Filter eq(io.spine.base.EventMessageField field, java.lang.Object value)
Filter
.field
- the event message field to filter byvalue
- the requested valueFilter
public static io.spine.client.Filter eq(io.spine.core.EventContextField field, java.lang.Object value)
Filter
.
The field path in the filter will be automatically prepended with "context."
to
enable filtering by event context.
field
- the event context field to filter byvalue
- the requested valueFilter
public static io.spine.client.Filter gt(java.lang.String fieldPath, java.lang.Object value)
Filter
.
For the supported types description, see Comparison types section.
fieldPath
- the field path or the entity column name for entity filtersvalue
- the requested valueFilter
public static io.spine.client.Filter gt(io.spine.base.EntityColumn column, java.lang.Object value)
Filter
.
For the supported types description, see Comparison types section.
column
- the entity column to filter byvalue
- the requested valueFilter
public static io.spine.client.Filter gt(io.spine.base.EntityStateField field, java.lang.Object value)
Filter
.
For the supported types description, see Comparison types section.
field
- the entity state field to filter byvalue
- the requested valueFilter
public static io.spine.client.Filter gt(io.spine.base.EventMessageField field, java.lang.Object value)
Filter
.
For the supported types description, see Comparison types section.
field
- the event message field to filter byvalue
- the requested valueFilter
public static io.spine.client.Filter gt(io.spine.core.EventContextField field, java.lang.Object value)
Filter
.
The field path in the filter will be automatically prepended with "context."
to
enable filtering by event context.
For the supported types description, see Comparison types section.
field
- the event context field to filter byvalue
- the requested valueFilter
public static io.spine.client.Filter lt(java.lang.String fieldPath, java.lang.Object value)
Filter
.
See Comparison types section for the supported types description.
fieldPath
- the field path or the entity column name for entity filtersvalue
- the requested valueFilter
public static io.spine.client.Filter lt(io.spine.base.EntityColumn column, java.lang.Object value)
Filter
.
For the supported types description, see Comparison types section.
column
- the entity column to filter byvalue
- the requested valueFilter
public static io.spine.client.Filter lt(io.spine.base.EntityStateField field, java.lang.Object value)
Filter
.
For the supported types description, see Comparison types section.
field
- the entity state field to filter byvalue
- the requested valueFilter
public static io.spine.client.Filter lt(io.spine.base.EventMessageField field, java.lang.Object value)
Filter
.
For the supported types description, see Comparison types section.
field
- the event message field to filter byvalue
- the requested valueFilter
public static io.spine.client.Filter lt(io.spine.core.EventContextField field, java.lang.Object value)
Filter
.
The field path in the filter will be automatically prepended with "context."
to
enable filtering by event context.
For the supported types description, see Comparison types section.
field
- the event context field to filter byvalue
- the requested valueFilter
public static io.spine.client.Filter ge(java.lang.String fieldPath, java.lang.Object value)
Filter
.
See Comparison types section for the supported types description.
fieldPath
- the field path or the entity column name for entity filtersvalue
- the requested valueFilter
public static io.spine.client.Filter ge(io.spine.base.EntityColumn column, java.lang.Object value)
Filter
.
See Comparison types section for the supported types description.
column
- the entity column to filter byvalue
- the requested valueFilter
public static io.spine.client.Filter ge(io.spine.base.EntityStateField field, java.lang.Object value)
Filter
.
See Comparison types section for the supported types description.
field
- the entity state field to filter byvalue
- the requested valueFilter
public static io.spine.client.Filter ge(io.spine.base.EventMessageField field, java.lang.Object value)
Filter
.
See Comparison types section for the supported types description.
field
- the event message field to filter byvalue
- the requested valueFilter
public static io.spine.client.Filter ge(io.spine.core.EventContextField field, java.lang.Object value)
Filter
.
The field path in the filter will be automatically prepended with "context."
to
enable filtering by event context.
See Comparison types section for the supported types description.
field
- the event context field to filter byvalue
- the requested valueFilter
public static io.spine.client.Filter le(java.lang.String fieldPath, java.lang.Object value)
Filter
.
See Comparison types section for the supported types description.
fieldPath
- the field path or the entity column name for entity filtersvalue
- the requested valueFilter
public static io.spine.client.Filter le(io.spine.base.EntityColumn column, java.lang.Object value)
Filter
.
See Comparison types section for the supported types description.
column
- the entity column to filter byvalue
- the requested valueFilter
public static io.spine.client.Filter le(io.spine.base.EntityStateField field, java.lang.Object value)
Filter
.
See Comparison types section for the supported types description.
field
- the entity state field to filter byvalue
- the requested valueFilter
public static io.spine.client.Filter le(io.spine.base.EventMessageField field, java.lang.Object value)
Filter
.
See Comparison types section for the supported types description.
field
- the event message field to filter byvalue
- the requested valueFilter
public static io.spine.client.Filter le(io.spine.core.EventContextField field, java.lang.Object value)
Filter
.
The field path in the filter will be automatically prepended with "context."
to
enable filtering by event context.
See Comparison types section for the supported types description.
field
- the event context field to filter byvalue
- the requested valueFilter
public static io.spine.client.CompositeFilter all(io.spine.client.Filter first, io.spine.client.Filter... rest)
A record is considered matching this filter if and only if it matches all of the aggregated filters.
first
- the first Filter
rest
- the array of additional filters, possibly emptyCompositeFilter
public static io.spine.client.CompositeFilter either(io.spine.client.Filter first, io.spine.client.Filter... rest)
A record is considered matching this filter if it matches at least one of the aggregated filters.
first
- the first Filter
rest
- the array of additional filters, possibly emptyCompositeFilter