ObjectFilterConditions

public class ObjectFilterConditions : Codable

Defines a set of conditions for filtering objects. Filter conditions can be combined by logical AND or OR.

Attributes.

  • and

    The set of (optional) filter conditions which are combined by logical AND.

    Declaration

    Swift

    internal(set) public var and: [ObjectFilterCondition]? { get }
  • or

    The set of (optional) filter conditions which are combined by logical OR.

    Declaration

    Swift

    internal(set) public var or: [ObjectFilterCondition]? { get }

Initializers.

  • Create an instance of ObjectFilterConditions.

    An object filter condition is defined by the name of an object property and a filter expression. The filter expression must evaluate to true when applied to the property’s value for the condition to become true.

    The object property to be applied for filtering is specified either in dot notation or array notation. In dot notation, the name of the object property is specified as a string (e.g. "objectId"). It may include dots (.) to access nested properties of subobjects (e.g. "message.name"). If a single property name contains dots itself, you obviously cannot use dot notation. Instead, specify the property or nested properties as an array of strings (e.g. ["property.with.dots", "subproperty.with.dots"]).

    A filter expression consists of a filter operator and an operator-specific number of filter operands (at most two). You should use one of the typesafe FilterOperations functions to specify a filter expression.

    Declaration

    Swift

    public convenience init(and: [ObjectFilterCondition])

    Parameters

    and

    Multiple filter conditions combined by logical AND. Specify either the and or the or property, or none, but never both.

  • Create an instance of ObjectFilterConditions.

    An object filter condition is defined by the name of an object property and a filter expression. The filter expression must evaluate to true when applied to the property’s value for the condition to become true.

    The object property to be applied for filtering is specified either in dot notation or array notation. In dot notation, the name of the object property is specified as a string (e.g. "objectId"). It may include dots (.) to access nested properties of subobjects (e.g. "message.name"). If a single property name contains dots itself, you obviously cannot use dot notation. Instead, specify the property or nested properties as an array of strings (e.g. ["property.with.dots", "subproperty.with.dots"]).

    A filter expression consists of a filter operator and an operator-specific number of filter operands (at most two). You should use one of the typesafe FilterOperations functions to specify a filter expression.

    Declaration

    Swift

    public convenience init(or: [ObjectFilterCondition])

    Parameters

    or

    Multiple filter conditions combined by logical OR. Specify either the and or the or property, or none, but never both.

Codable methods.

  • Declaration

    Swift

    public func encode(to encoder: Encoder) throws
  • Declaration

    Swift

    public required init(from decoder: Decoder) throws

Builder methods.

  • Builds a new ObjectFilterConditions object using the convenience closure syntax. Using this builder method the conditions will automatically be linked using logical AND.

    Note

    You may want to consider to use the usual initializer instead and construct the array of ObjectFilterCondition objects using the dedicated single instance builder.

    Declaration

    Swift

    public static func buildAnd(_ closure: (ObjectFilterConditionsBuilder) throws -> ()) throws -> ObjectFilterConditions

    Parameters

    closure

    the builder closure, preferably used as trailing closure.

    Return Value

    ObjectFilterConditions configured using the builder.

  • Builds a new ObjectFilterConditions object using the convenience closure syntax. Using this builder method the conditions will automatically be linked using logical OR.

    Note

    You may want to consider to use the usual initializer instead and construct the array of ObjectFilterCondition objects using the dedicated single instance builder.

    Declaration

    Swift

    public static func buildOr(_ closure: (ObjectFilterConditionsBuilder) throws -> ()) throws -> ObjectFilterConditions

    Parameters

    closure

    the builder closure, preferably used as trailing closure.

    Return Value

    ObjectFilterConditions configured using the builder.