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

ByStringFilterOperation Class

Modifiers: final
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") }

Signature

class ByStringFilterOperation(val attrId: Int, val filterBuilder: FilterBuilder)

Constructors

ByStringFilterOperation ( attrId , filterBuilder )
Signature
constructor(attrId: Int, filterBuilder: FilterBuilder)
Parameters
attrId: Int
  The attribute id of the String attribute for the filter operation.
filterBuilder: FilterBuilder
  The filter builder object used to create the filter node.

Properties

attrId : Int
[Get]
Signature
val attrId: Int
filterBuilder : FilterBuilder
[Get]
Signature
val filterBuilder: FilterBuilder

Functions

contains ( value )
Creates a filter node representing a contains condition with the given string value.
Signature
fun contains(value: String): ByStringFilterNode
Parameters
value: String
  The substring to check for within the string attribute.
Returns
  A filter node representing the contains condition.
endsWith ( value )
Creates a filter node representing an ends with condition with the given string value.
Signature
fun endsWith(value: String): ByStringFilterNode
Parameters
value: String
  The suffix to check for at the end of the string attribute.
Returns
  A filter node representing the ends with condition.
greaterThan ( value )
Creates a filter node representing a greater than condition with the given string value.
Signature
fun greaterThan(value: String): ByStringFilterNode
Parameters
value: String
  The string value to compare against.
Returns
  A filter node representing the greater than condition.
greaterThanOrEqualTo ( value )
Creates a filter node representing a greater than or equal to condition with the given string value.
Signature
fun greaterThanOrEqualTo(value: String): ByStringFilterNode
Parameters
value: String
  The string value to compare against.
Returns
  A filter node representing the greater than or equal to condition.
isEqualTo ( value )
Creates a filter node representing an equality condition with the given string value.
Signature
fun isEqualTo(value: String): ByStringFilterNode
Parameters
value: String
  The string value to compare against.
Returns
  A filter node representing the equality condition.
isEqualToCaseInsensitive ( value )
Creates a filter node representing a case-insensitive equality condition with the given string value.
Signature
fun isEqualToCaseInsensitive(value: String): ByStringFilterNode
Parameters
value: String
  The string value to compare against, ignoring case.
Returns
  A filter node representing the case-insensitive equality condition.
lessThan ( value )
Creates a filter node representing a less than condition with the given string value.
Signature
fun lessThan(value: String): ByStringFilterNode
Parameters
value: String
  The string value to compare against.
Returns
  A filter node representing the less than condition.
lessThanOrEqualTo ( value )
Creates a filter node representing a less than or equal to condition with the given string value.
Signature
fun lessThanOrEqualTo(value: String): ByStringFilterNode
Parameters
value: String
  The string value to compare against.
Returns
  A filter node representing the less than or equal to condition.
startsWith ( value )
Creates a filter node representing a starts with condition with the given string value.
Signature
fun startsWith(value: String): ByStringFilterNode
Parameters
value: String
  The prefix to check for at the beginning of the string attribute.
Returns
  A filter node representing the starts with condition.