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

ByMapFilterOperation Class

Modifiers: final
A class representing a filter operation for Map attributes. It is used to build a filter expression by specifying key-based operations on Map attribute values.
This class provides methods for creating filter nodes that represent operations on Map attributes, such as checking if a map contains a specific key. These filter nodes can then be combined using logical operators (AND, OR) to create complex filtering conditions.
Example:
// Find entities where intToStringMap contains key 42
Query.where { has(TestComponent.id) }
     .filter { by(TestComponent.intToStringMapVarData).containsKey(42) }
// Find entities where stringToIntMap contains either "foo" or "bar" keys
Query.where { has(TestComponent.id) }
     .filter { by(TestComponent.stringToIntMapVarData).containsKey("foo") or
               by(TestComponent.stringToIntMapVarData).containsKey("bar") }

Signature

class ByMapFilterOperation<KeyType, ValueType>(val attrId: Int, val filterBuilder: FilterBuilder)

Constructors

ByMapFilterOperation ( attrId , filterBuilder ) : ByMapFilterOperation
Signature
constructor(attrId: Int, filterBuilder: FilterBuilder)
Parameters
attrId: Int
The attribute id of 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

containsKey ( key ) : ByMapFilterNode
Creates a filter node representing a condition that checks if a map contains a specific key.
Signature
fun containsKey(key: KeyType): ByMapFilterNode<KeyType, ValueType>
Parameters
The key to check for in the map.
Returns
A filter node representing the condition.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon