SortItem
open class SortItem : ObjectBase
Encapsulates an OData sort item. A sort item indicates a property (or expression) that is used in the $orderby system query option.
-
Obsolete. Use
of
with unlabeled parameter.Declaration
Swift
public static func of(property: Property) -> SortItem
-
Sort order, which defaults to
SortOrder.ascending
.See also
DataQuery.orderBy
.Declaration
Swift
final public var order: SortOrder
-
Default initializer.
Declaration
Swift
override public init()
-
Declaration
Swift
open func copyMutable() -> SortItem
Return Value
a copy of this item which doesn’t share mutable values with this item.
-
Declaration
Swift
open class func of(_ value: QueryValue) -> SortItem
Parameters
value
Value for result ordering.
Return Value
A new sort item for the specified value.
-
If this sort item references a property or path, then return the path representation. Otherwise return
nil
.Declaration
Swift
open func toPath() -> DataPath?
Return Value
The property to be selected, or
nil
. -
If this sort item directly references a property, then return the property. Otherwise return
nil
.Declaration
Swift
open func toProperty() -> Property?
Return Value
The property to be selected, or
nil
. -
If this sort item references a simple property path, then return the property. Otherwise throw an exception.
Throws
UndefinedException
if this sort item does not reference a simple property path.Declaration
Swift
open func toRequiredProperty() -> Property
Return Value
The property to be selected.
-
Declaration
Swift
override open func toString() -> String
Return Value
A string representation of this sort item.
-
An expression that, when evaluated, will be used for query result ordering.
Declaration
Swift
public final var value: QueryValue { get set }