Package-level declarations

Types

Link copied to clipboard
data class AfterNowFilter(val field: QueryField, val offset: String = ZERO_OFFSET, val zoneId: String? = null, val datePattern: String? = null, val dateFormatter: DateTimeFormatter? = null, val timeUnit: TimeUnit = TimeUnit.MILLISECONDS) : RelativeTimeFilter

The field is after now + offset; see BeforeNowFilter.

Link copied to clipboard
data class AggregateIdFilter(val value: String) : FilterExpression
Link copied to clipboard
data class AggregateIdsFilter(val values: List<String>) : FilterExpression
Link copied to clipboard

A calendar part of an instant, with its fixed integer domain [min, max].

Link copied to clipboard
data class AggregationElement(val path: QueryField, val filter: FilterExpression = MatchAllFilter)
Link copied to clipboard
sealed interface AggregationExpression

One numeric contribution per current root or expanded record, for data conforming to its numeric schema. FIELD selects the sole non-null numeric value; missing, empty and multi-valued fields do not contribute. Repeated numeric values remain separate values. BINARY computes finite doubles; it does not pair arrays or preserve arbitrary native numeric precision.

Link copied to clipboard
sealed interface AggregationGroup
Link copied to clipboard
sealed interface AggregationMetric
Link copied to clipboard
data class AggregationQuery(val filter: FilterExpression = MatchAllFilter, val elements: List<AggregationElement> = emptyList(), val groupBy: List<AggregationGroup> = emptyList(), val metrics: List<AggregationMetric>, val sort: List<Sort> = emptyList(), val limit: Int = DEFAULT_LIMIT, val having: HavingExpression? = null) : FilterCapable<AggregationQuery> , SortCapable
Link copied to clipboard
data class AndFilter(val operands: List<FilterExpression>) : FilterExpression
Link copied to clipboard
data class BeforeNowFilter(val field: QueryField, val offset: String = ZERO_OFFSET, val zoneId: String? = null, val datePattern: String? = null, val dateFormatter: DateTimeFormatter? = null, val timeUnit: TimeUnit = TimeUnit.MILLISECONDS) : RelativeTimeFilter

A moment relative to the server's clock: the field is before now + offset. The server resolves now once per query, so every condition of one query sees the same moment and the client's clock does not matter.

Link copied to clipboard
data class BeforeTodayFilter(val field: QueryField, val time: String, val zoneId: String? = null, val datePattern: String? = null, val dateFormatter: DateTimeFormatter? = null, val timeUnit: TimeUnit = TimeUnit.MILLISECONDS) : RelativeTimeFilter
Link copied to clipboard
data class BetweenFilter(val field: QueryField, val lowerBound: JsonNode, val upperBound: JsonNode) : FieldPredicate
Link copied to clipboard
data class Condition(val field: String = EMPTY_VALUE, val operator: Operator = Operator.ALL, val value: Any = EMPTY_VALUE, val children: List<Condition> = emptyList(), val options: Map<String, Any> = emptyMap()) : ICondition<Condition>

Represents a concrete query condition with support for various comparison operators and logical combinations.

Link copied to clipboard

Marker interface for condition options. Implementations can define additional configuration options for query conditions.

Link copied to clipboard
data class ContainsAllFilter(val field: QueryField, val values: List<JsonNode>) : FieldPredicate
Link copied to clipboard
data class ContainsFilter(val field: QueryField, val value: String, val stringComparison: StringComparison = StringComparison.CASE_SENSITIVE) : FieldPredicate
Link copied to clipboard
data class CursorPage<out T>(val list: List<T>, val nextCursor: String?)
Link copied to clipboard
data class CursorQuery(val filter: FilterExpression, val projection: Projection = Projection.ALL, val sort: List<Sort> = emptyList(), val size: Int = DEFAULT_SIZE, val cursor: String? = null) : ICursorQuery
Link copied to clipboard

A fixed-length unit of elapsed time. Calendar units (months, years) have no fixed length and depend on a time zone, so they are not offered; a DAY is exactly 24 hours.

Link copied to clipboard
data class DeletionFilter(val deletionState: DeletionState) : FilterExpression
Link copied to clipboard

Enumeration representing the possible states of deletion for entities in the system.

Link copied to clipboard
sealed interface DerivedExpression
Link copied to clipboard
data class EarlierDaysFilter(val field: QueryField, val days: Int, val zoneId: String? = null, val datePattern: String? = null, val dateFormatter: DateTimeFormatter? = null, val timeUnit: TimeUnit = TimeUnit.MILLISECONDS) : RelativeTimeFilter
Link copied to clipboard
data class ElementMatchFilter(val field: QueryField, val predicate: FilterExpression) : FieldPredicate
Link copied to clipboard
data class EndsWithFilter(val field: QueryField, val value: String, val stringComparison: StringComparison = StringComparison.CASE_SENSITIVE) : FieldPredicate
Link copied to clipboard
data class EqualFilter(val field: QueryField, val value: JsonNode) : FieldPredicate
Link copied to clipboard
data class ExistsFilter(val field: QueryField) : FieldPredicate
Link copied to clipboard
data class ExpressionFilter(val expression: AggregationExpression, val comparison: ComparisonOperator, val value: Double) : FilterExpression

Compares a computed expression, for example the hours from paidAt to shippedAt, with value. A record whose expression has no value (an operand is absent, or a division by zero) does not match, whatever the comparison. The expression is evaluated per record and cannot use an index, so the operator is expensive.

Link copied to clipboard
sealed interface FieldPredicate : FilterExpression

A filter on one field the request names: the comparison, string, membership, presence and relative-time predicates, and ELEMENT_MATCH, whose field is the collection its predicate applies to. System-field, logical, search and expression filters name no single field and are not field predicates.

Link copied to clipboard
Link copied to clipboard

Numeric predicates compare the selected backend's stored or indexed representation, including its precision and quantization. Exact-match capability does not promise arbitrary-precision equality with a source value. Explicit string-comparison contracts remain independent of numeric representation.

Link copied to clipboard
Link copied to clipboard
data class GreaterThanFilter(val field: QueryField, val value: JsonNode) : FieldPredicate
Link copied to clipboard
data class GreaterThanOrEqualFilter(val field: QueryField, val value: JsonNode) : FieldPredicate
Link copied to clipboard
sealed interface HavingExpression
Link copied to clipboard
interface ICondition<C : ICondition<C>>

Represents a generic condition interface for building query criteria.

Link copied to clipboard
Link copied to clipboard
data class IdFilter(val value: String) : FilterExpression
Link copied to clipboard
data class IdsFilter(val values: List<String>) : FilterExpression
Link copied to clipboard

Interface for list queries that retrieve multiple items with a limit.

Link copied to clipboard

Interface for materialized snapshots that contain state data and metadata.

Link copied to clipboard
data class InFilter(val field: QueryField, val values: List<JsonNode>) : FieldPredicate
Link copied to clipboard
interface IPagedList<out T>

Interface representing a paginated list of items with total count information.

Link copied to clipboard

Interface for paginated queries that retrieve items in pages.

Link copied to clipboard
data class IsEmptyFilter(val field: QueryField) : FieldPredicate
Link copied to clipboard
Link copied to clipboard

Interface for single-item queries that retrieve at most one result.

Link copied to clipboard
Link copied to clipboard
data class IsNotNullFilter(val field: QueryField) : FieldPredicate
Link copied to clipboard
data class IsNullFilter(val field: QueryField) : FieldPredicate
Link copied to clipboard
data class LastMonthFilter(val field: QueryField, val zoneId: String? = null, val datePattern: String? = null, val dateFormatter: DateTimeFormatter? = null, val timeUnit: TimeUnit = TimeUnit.MILLISECONDS) : RelativeTimeFilter
Link copied to clipboard
data class LastWeekFilter(val field: QueryField, val zoneId: String? = null, val datePattern: String? = null, val dateFormatter: DateTimeFormatter? = null, val timeUnit: TimeUnit = TimeUnit.MILLISECONDS) : RelativeTimeFilter
Link copied to clipboard
data class LastYearFilter(val field: QueryField, val zoneId: String? = null, val datePattern: String? = null, val dateFormatter: DateTimeFormatter? = null, val timeUnit: TimeUnit = TimeUnit.MILLISECONDS) : RelativeTimeFilter
Link copied to clipboard
data class LessThanFilter(val field: QueryField, val value: JsonNode) : FieldPredicate
Link copied to clipboard
data class LessThanOrEqualFilter(val field: QueryField, val value: JsonNode) : FieldPredicate
Link copied to clipboard
data class ListQuery(val filter: FilterExpression, val projection: Projection = Projection.ALL, val sort: List<Sort> = emptyList(), val limit: Int = 0) : IListQuery

Data class representing a query for retrieving a list of items with optional filtering, projection, sorting, and limiting.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class MaterializedSnapshot<S : Any>(val contextName: String, val aggregateName: String, val tenantId: String, val ownerId: String = OwnerId.DEFAULT_OWNER_ID, val spaceId: SpaceId = SpaceIdCapable.DEFAULT_SPACE_ID, val aggregateId: String, val version: Int, val eventId: String, val firstOperator: String, val operator: String, val firstEventTime: Long, val eventTime: Long, val state: S, val snapshotTime: Long, val tags: AbacTags = EMPTY_ABAC_TAGS, val deleted: Boolean) : IMaterializedSnapshot<MaterializedSnapshot<S>, S> , NamedAggregate, TenantId, OwnerId, SpaceIdCapable, Version, EventIdCapable, FirstOperatorCapable, OperatorCapable, FirstEventTimeCapable, EventTimeCapable, SnapshotTimeCapable, AbacTaggable, DeletedCapable

Data class representing a complete materialized snapshot of an aggregate's state.

Link copied to clipboard
data class MediumMaterializedSnapshot<S : Any>(val tenantId: String, val ownerId: String = OwnerId.DEFAULT_OWNER_ID, val spaceId: SpaceId = SpaceIdCapable.DEFAULT_SPACE_ID, val version: Int, val eventId: String, val firstOperator: String, val operator: String, val firstEventTime: Long, val eventTime: Long, val state: S, val tags: AbacTags = EMPTY_ABAC_TAGS) : IMaterializedSnapshot<MediumMaterializedSnapshot<S>, S> , TenantId, OwnerId, SpaceIdCapable, Version, EventIdCapable, FirstOperatorCapable, OperatorCapable, FirstEventTimeCapable, EventTimeCapable, AbacTaggable

Represents a materialized snapshot for medium data, implementing multiple capabilities through inheritance. This class is designed to be generic, capable of holding state data of any type. Each snapshot corresponds to a specific version of the state within a tenant and owner context, and records information such as event IDs and operation times to support tracing and auditing.

Link copied to clipboard
data class NextMonthFilter(val field: QueryField, val zoneId: String? = null, val datePattern: String? = null, val dateFormatter: DateTimeFormatter? = null, val timeUnit: TimeUnit = TimeUnit.MILLISECONDS) : RelativeTimeFilter
Link copied to clipboard
data class NextWeekFilter(val field: QueryField, val zoneId: String? = null, val datePattern: String? = null, val dateFormatter: DateTimeFormatter? = null, val timeUnit: TimeUnit = TimeUnit.MILLISECONDS) : RelativeTimeFilter
Link copied to clipboard
data class NextYearFilter(val field: QueryField, val zoneId: String? = null, val datePattern: String? = null, val dateFormatter: DateTimeFormatter? = null, val timeUnit: TimeUnit = TimeUnit.MILLISECONDS) : RelativeTimeFilter
Link copied to clipboard
data class NorFilter(val operands: List<FilterExpression>) : FilterExpression
Link copied to clipboard
data class NotEqualFilter(val field: QueryField, val value: JsonNode) : FieldPredicate
Link copied to clipboard
data class NotExistsFilter(val field: QueryField) : FieldPredicate
Link copied to clipboard
data class NotInFilter(val field: QueryField, val values: List<JsonNode>) : FieldPredicate
Link copied to clipboard

Enumeration of query operators used for building database query conditions.

Link copied to clipboard
data class OrFilter(val operands: List<FilterExpression>) : FilterExpression
Link copied to clipboard
data class OwnerIdFilter(val value: String) : FilterExpression
Link copied to clipboard
data class PagedList<out T>(val total: Long, val list: List<T>) : IPagedList<T>

Data class implementing a paginated list of items.

Link copied to clipboard
data class PagedQuery(val filter: FilterExpression, val projection: Projection = Projection.ALL, val sort: List<Sort> = emptyList(), val pagination: Pagination = Pagination.DEFAULT) : IPagedQuery

Data class representing a paginated query with filtering, projection, sorting, and pagination.

Link copied to clipboard
data class Pagination(val index: Int = 1, val size: Int = 10)

Data class representing pagination settings for queries.

Link copied to clipboard
data class Projection(val include: List<QueryField> = emptyList(), val exclude: List<QueryField> = emptyList())

Data class representing field projection settings for queries.

Link copied to clipboard

Interface for query objects that support field projection.

Link copied to clipboard

Interface for query objects that support comprehensive querying capabilities.

Link copied to clipboard

Stable, machine-readable codes of rejected query requests, carried as BindingError.code. A contract: codes are added, never renamed or reused. Clients switch on them instead of on the human text.

Link copied to clipboard
data class QueryField(val path: String)
Link copied to clipboard
data class RecentDaysFilter(val field: QueryField, val days: Int, val zoneId: String? = null, val datePattern: String? = null, val dateFormatter: DateTimeFormatter? = null, val timeUnit: TimeUnit = TimeUnit.MILLISECONDS) : RelativeTimeFilter
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Interface for query objects that support projection rewriting and modification.

Link copied to clipboard
data class SearchFilter(val query: String, val fields: Set<QueryField> = emptySet(), val mode: SearchMode = SearchMode.TERMS) : FilterExpression
Link copied to clipboard
Link copied to clipboard
data class SingleQuery(val filter: FilterExpression, val projection: Projection = Projection.ALL, val sort: List<Sort> = emptyList()) : ISingleQuery

Data class representing a query for retrieving a single item with optional filtering, projection, and sorting.

Link copied to clipboard
data class SmallMaterializedSnapshot<S : Any>(val version: Int, val firstEventTime: Long, val state: S) : Version, FirstEventTimeCapable, IMaterializedSnapshot<SmallMaterializedSnapshot<S>, S>

Represents a simplified materialized snapshot with generic state. This data class implements multiple interfaces to provide version, materialization, first event time, and state information.

Link copied to clipboard
data class Sort(val field: QueryField, val direction: Sort.Direction)

Data class representing a sorting criterion for query results.

Link copied to clipboard
interface SortCapable

Interface for query objects that support sorting capabilities.

Link copied to clipboard
data class SpaceIdFilter(val value: String) : FilterExpression
Link copied to clipboard
data class StartsWithFilter(val field: QueryField, val value: String, val stringComparison: StringComparison = StringComparison.CASE_SENSITIVE) : FieldPredicate
Link copied to clipboard
Link copied to clipboard
data class TenantIdFilter(val value: String) : FilterExpression
Link copied to clipboard
data class ThisMonthFilter(val field: QueryField, val zoneId: String? = null, val datePattern: String? = null, val dateFormatter: DateTimeFormatter? = null, val timeUnit: TimeUnit = TimeUnit.MILLISECONDS) : RelativeTimeFilter
Link copied to clipboard
data class ThisWeekFilter(val field: QueryField, val zoneId: String? = null, val datePattern: String? = null, val dateFormatter: DateTimeFormatter? = null, val timeUnit: TimeUnit = TimeUnit.MILLISECONDS) : RelativeTimeFilter
Link copied to clipboard
data class ThisYearFilter(val field: QueryField, val zoneId: String? = null, val datePattern: String? = null, val dateFormatter: DateTimeFormatter? = null, val timeUnit: TimeUnit = TimeUnit.MILLISECONDS) : RelativeTimeFilter
Link copied to clipboard
data class TodayFilter(val field: QueryField, val zoneId: String? = null, val datePattern: String? = null, val dateFormatter: DateTimeFormatter? = null, val timeUnit: TimeUnit = TimeUnit.MILLISECONDS) : RelativeTimeFilter
Link copied to clipboard
data class TomorrowFilter(val field: QueryField, val zoneId: String? = null, val datePattern: String? = null, val dateFormatter: DateTimeFormatter? = null, val timeUnit: TimeUnit = TimeUnit.MILLISECONDS) : RelativeTimeFilter
Link copied to clipboard
data class YesterdayFilter(val field: QueryField, val zoneId: String? = null, val datePattern: String? = null, val dateFormatter: DateTimeFormatter? = null, val timeUnit: TimeUnit = TimeUnit.MILLISECONDS) : RelativeTimeFilter

Properties

Link copied to clipboard

The fields an expression reads, in tree order.

Link copied to clipboard

The computed input of a TERMS or HISTOGRAM group in place of its field, or null.

Functions

Link copied to clipboard

The direct child filters of this node: the operands of AND / OR / NOR and the predicate of ELEMENT_MATCH. Every other node is a leaf and returns an empty list. The one walker of a filter tree: consumers that visit the tree read the children from here instead of matching the logical nodes themselves.

Link copied to clipboard

Checks if this projection has no field filtering (includes all fields).

Link copied to clipboard
Link copied to clipboard
fun <S : Any, D : Any> MaterializedSnapshot<S>.toSmall(materialize: (S) -> D): SmallMaterializedSnapshot<D>

Converts a materialized snapshot into a simplified snapshot form. This function is used to transform a full snapshot into a simplified snapshot with transformed state.