Adapts a WexOrderInfoResult to a LimitOrder

@param orderId Order original id
@param orderInfo
@return
545949
public static LimitOrder adaptOrderInfo(String orderId, WexOrderInfoResult orderInfo) {

    OrderType orderType =
        orderInfo.getType() == WexOrderInfoResult.Type.buy ? OrderType.BID : OrderType.ASK;
    BigDecimal price = orderInfo.getRate();
    Date timestamp = DateUtils.fromMillisUtc(orderInfo.getTimestampCreated() * 1000L);
    CurrencyPair currencyPair = adaptCurrencyPair(orderInfo.getPair());
    OrderStatus orderStatus = null;
    switch (orderInfo.getStatus()) {
      case 0:
        if (orderInfo.getAmount().compareTo(orderInfo.getStartAmount()) == 0) {
          orderStatus = OrderStatus.NEW;
        } else {
          orderStatus = OrderStatus.PARTIALLY_FILLED;
        }
        break;
      case 1:
        orderStatus = OrderStatus.FILLED;
        break;
      case 2:
      case 3:
        orderStatus = OrderStatus.CANCELED;
        break;
    }

    return new LimitOrder(
        orderType,
        orderInfo.getStartAmount(),
        currencyPair,
        orderId,
        timestamp,
        price,
        price,
        orderInfo.getStartAmount().subtract(orderInfo.getAmount()),
        null,
        orderStatus);
  }
346341
def openOrder(self, orderId, arg0, arg1, arg2):
        """"""
        return _swigibpy.EWrapper_openOrder(self, orderId, arg0, arg1, arg2)
1289924
@RequestMapping(path = "/{orderId}", method = {RequestMethod.GET, RequestMethod.POST})
    public ResponseEntity<Order> getOrder(@PathVariable("orderId") Long orderId) {
        Order order = orderService.getOrder(orderId);
        if(order != null){
            return new ResponseEntity(order, HttpStatus.OK);
        }
        return new ResponseEntity<Order>(HttpStatus.NOT_FOUND);
    }
405702
public SqlBuilder orderBy(final List<Order> orders) {
    if (null != orders) {
      this.orders.addAll(orders);
    }
    return this;
  }
399929
public OkCoinOrderResult getOrder(String symbol, Integer type, String... orderIds)
      throws IOException {
    if (orderIds == null || orderIds.length > 50) {
      throw new UnsupportedOperationException(
          "Can only get 1 to 50 orders. " + orderIds.length + " orders provided.");
    }
    String ids = Arrays.stream(orderIds).collect(Collectors.joining(","));

    return super.getOrder(symbol, type, ids);
  }
823156
public void update(OrderBookUpdate orderBookUpdate) {

    LimitOrder limitOrder = orderBookUpdate.getLimitOrder();
    List<LimitOrder> limitOrders = getOrders(limitOrder.getType());
    int idx = Collections.binarySearch(limitOrders, limitOrder);
    if (idx >= 0) {
      limitOrders.remove(idx);
    } else {
      idx = -idx - 1;
    }

    if (orderBookUpdate.getTotalVolume().compareTo(BigDecimal.ZERO) != 0) {
      LimitOrder updatedOrder = withAmount(limitOrder, orderBookUpdate.getTotalVolume());
      limitOrders.add(idx, updatedOrder);
    }

    updateDate(limitOrder.getTimestamp());
  }
219597
public OqlBuilder<T> orderBy(final List<Order> orders) {
    if (null != orders) {
      if (isNotEmpty(statement)) { throw new RuntimeException("cannot add order by to a exists statement."); }
      this.orders.addAll(orders);
    }
    return this;
  }
751574
public OkCoinOrderResult getOrder(long orderId, String symbol) throws IOException {

    OkCoinOrderResult orderResult = okCoin.getOrder(apikey, orderId, symbol, signatureCreator());
    return returnOrThrow(orderResult);
  }
318612
@RequestMapping(path = "", method = RequestMethod.POST)
    public ResponseEntity<Order> createOrder(@RequestBody OrderInfo orderInfo) {
        Order order = orderService.createOrder(orderInfo);
        if(order != null){
            return new ResponseEntity<Order>(order, HttpStatus.CREATED);
        }
        return new ResponseEntity<Order>(HttpStatus.BAD_REQUEST);
    }
406065
private function configureWindow(SelectQuery $query, array $orderBy, int $limit = 0)
    {
        if (!empty($orderBy)) {
            $decorator = new AliasDecorator($query, 'where', $this->getAlias());
            $decorator->orderBy($orderBy);
        }

        if ($limit !== 0) {
            $query->limit($limit);
        }
    }
307
public function selectAll($where=false, $order=false, $limit=false) {
        $clause = false;
        $values = array();
        if ( is_array($where) ) {
            $retval = self::extractWhere($where, $clause, $values);
            if ( is_string($retval) ) throw new \Exception($val);
        }
        $orderby = '';
        if ( is_string($order) ) {
            $orderby = self::extractOrder($order);
            if ( $orderby === false ) throw new \Exception('Invalid Order value');
        }

        $sql = "SELECT KVS.id AS id, json_body, KVS.created_at, KVS.updated_at
            FROM $this->KVS_TABLE AS KVS
            WHERE $this->KVS_FK_NAME = :foreign_key";
        if ( $clause ) $sql .= ' AND '.$clause;
        if ( $orderby ) $sql .= ' '.$orderby;
        $values[':foreign_key'] = $this->KVS_FK;
        $rows = $this->PDOX->allRowsDie($sql, $values);
        return $rows;
    }
760170
public OvhOperation order_orderId_debt_operation_operationId_GET(Long orderId, Long operationId) throws IOException {
		String qPath = "/me/order/{orderId}/debt/operation/{operationId}";
		StringBuilder sb = path(qPath, orderId, operationId);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhOperation.class);
	}
1330271
public static LimitOrder adaptOrder(
      BigDecimal amount,
      BigDecimal price,
      CurrencyPair currencyPair,
      OrderType orderType,
      String id) {

    return new LimitOrder(orderType, amount, currencyPair, id, null, price);
  }
367064
public OrderItem createOrderItem() {
        if (orderByItemSegment instanceof IndexOrderByItemSegment) {
            return createOrderItem((IndexOrderByItemSegment) orderByItemSegment);
        }
        if (orderByItemSegment instanceof ColumnOrderByItemSegment) {
            return createOrderItem(selectStatement, (ColumnOrderByItemSegment) orderByItemSegment);
        }
        if (orderByItemSegment instanceof ExpressionOrderByItemSegment) {
            return createOrderItem(selectStatement, (ExpressionOrderByItemSegment) orderByItemSegment);
        }
        throw new UnsupportedOperationException();
    }
966990
public OvhPaymentMeans order_orderId_paymentMeans_GET(Long orderId) throws IOException {
		String qPath = "/me/order/{orderId}/paymentMeans";
		StringBuilder sb = path(qPath, orderId);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhPaymentMeans.class);
	}
777859
public OvhOrderDetail order_orderId_details_orderDetailId_GET(Long orderId, Long orderDetailId) throws IOException {
		String qPath = "/me/order/{orderId}/details/{orderDetailId}";
		StringBuilder sb = path(qPath, orderId, orderDetailId);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhOrderDetail.class);
	}
244234
public static com.liferay.commerce.model.CommerceOrderItem createCommerceOrderItem(
		long commerceOrderItemId) {
		return getService().createCommerceOrderItem(commerceOrderItemId);
	}