InclusiveRange

public struct InclusiveRange<I> : Operation where I : Identifier

A codable struct enabling to filter with an inclusive range

Usage Example:

To filter on age using an inclusive range, we would write:

struct MyQuery: QueryParams {
  let age: InclusiveRange<Int>
}
let query = MyQuery(age: InclusiveRange(start: 8, end: 14))

In a URL it would translate to:

?age=8,14

Note: The “age=8,14” format is not an API but an implementation detail that could change in the future.

  • Creates a InclusiveRange instance from given start and end values

    Declaration

    Swift

    public init(start: I, end: I)
  • Creates a InclusiveRange instance from a given String value

    Declaration

    Swift

    public init(string value: String) throws
  • Returns the stored values as a tuple

    Declaration

    Swift

    public func getValue() -> (start: I, end: I)
  • Returns the stored value as a String

    Declaration

    Swift

    public func getStringValue() -> String
  • Returns the Operator

    Declaration

    Swift

    public func getOperator() -> Operator