API reference
API reference
Select your platform
No SDKs available
No versions available

ByStringFilterOperation

ByStringFilterOperation

class ByStringFilterOperation(val attrId: Int, val filterBuilder: FilterBuilder)
A class representing a filter operation for string attributes. It is used to build a filter expression by specifying comparison and pattern matching operations on string attribute values.
This class provides methods for creating filter nodes that represent various string operations, such as equality, comparison, case-insensitive matching, contains, startsWith, and endsWith. These filter nodes can then be combined using logical operators (AND, OR) to create complex filtering conditions.
Example:
// Find entities where stringVar equals "hello"
Query.where { has(TestComponent.id) }
     .filter { by(TestComponent.stringVarData).isEqualTo("hello") }

// Find entities where stringVar contains "world"
Query.where { has(TestComponent.id) }
     .filter { by(TestComponent.stringVarData).contains("world") }

// Find entities where stringVar starts with "hello" and ends with "world"
Query.where { has(TestComponent.id) }
     .filter { by(TestComponent.stringVarData).startsWith("hello") and
               by(TestComponent.stringVarData).endsWith("world") }

Constructors

NameSummary
ByStringFilterOperation
constructor(attrId: Int, filterBuilder: FilterBuilder)

Properties

NameSummary
attrId
val attrId: Int
filterBuilder
val filterBuilder: FilterBuilder

Functions

NameSummary
contains
fun contains(value: String): ByStringFilterNode

Creates a filter node representing a contains condition with the given string value.
endsWith
fun endsWith(value: String): ByStringFilterNode

Creates a filter node representing an ends with condition with the given string value.
greaterThan
fun greaterThan(value: String): ByStringFilterNode

Creates a filter node representing a greater than condition with the given string value.
greaterThanOrEqualTo
fun greaterThanOrEqualTo(value: String): ByStringFilterNode

Creates a filter node representing a greater than or equal to condition with the given string value.
isEqualTo
fun isEqualTo(value: String): ByStringFilterNode

Creates a filter node representing an equality condition with the given string value.
isEqualToCaseInsensitive
fun isEqualToCaseInsensitive(value: String): ByStringFilterNode

Creates a filter node representing a case-insensitive equality condition with the given string value.
lessThan
fun lessThan(value: String): ByStringFilterNode

Creates a filter node representing a less than condition with the given string value.
lessThanOrEqualTo
fun lessThanOrEqualTo(value: String): ByStringFilterNode

Creates a filter node representing a less than or equal to condition with the given string value.
startsWith
fun startsWith(value: String): ByStringFilterNode

Creates a filter node representing a starts with condition with the given string value.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon