EntityQueryComparator
class · iOS 16.0+ · SDK 27.1
class EntityQueryComparator<Property, PropertyType, InputType, ComparatorMappingType> where Property : EntityProperty<PropertyType>, PropertyType : _IntentValue, PropertyType : Sendable, InputType : _IntentValueThe base class for all concrete entity query comparators. An entity query comparator specifies a particular query comparison that can be made against a ``EntityQueryProperty``. For each query property comparator, `mappingTransform` maps the user-supplied `Value` at runtime into a `ComparatorMappingType` type of your choice. The following example illustrates the declaration of a ``EntityQueryProperty`` on a fictional `IntentPersonEntity` that allows finding entities by strict equality or prefix on the entity `firstName` property by defining its supported `EntityQueryComparator`s: ``` Property(\.$firstName) { EqualToComparator { value in // This is called at runtime with `value` being the user-supplied value. // For example, value would be: "John" when the user says: // "Hey Siri, find persons named John", given the appropriate mapping // in the application's Siri metadata. // This closure returns an object of type `ComparatorMappingType`. In the context of // a `EntityQuery`, every `EntityQueryComparator` must return the same output type, // which is the Query's `ComparatorMappingType`. return "firstName must be equal to \{value}" } HasPrefixComparator { "firstName must start with \{$0}" } } ``` ## Resolvers Additionally, you can supply a set of ``Resolver``s to fine-tune how the system will transform a user's supplied value into into the target `Value` type.
Members (0)
This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.
Skipped declarations
No declarations were skipped in this snapshot.