22 lines
634 B
JavaScript
22 lines
634 B
JavaScript
import { OrderBy } from "./OrderBy";
|
|
import { OrderType, OrderTypes } from "./OrderType";
|
|
export class Order {
|
|
orderBy;
|
|
orderType;
|
|
constructor(orderBy, orderType) {
|
|
this.orderBy = orderBy;
|
|
this.orderType = orderType;
|
|
}
|
|
static none() {
|
|
return new Order(new OrderBy(""), new OrderType(OrderTypes.NONE));
|
|
}
|
|
static fromPrimitives(orderBy, orderType) {
|
|
return orderBy !== null
|
|
? new Order(new OrderBy(orderBy), new OrderType(orderType))
|
|
: Order.none();
|
|
}
|
|
isNone() {
|
|
return this.orderType.isNone();
|
|
}
|
|
}
|
|
//# sourceMappingURL=Order.js.map
|