All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.knowm.xchange.exx.dto.params.EXXTradeHistoryParams Maven / Gradle / Ivy

There is a newer version: 4.3.17.1
Show newest version
package org.knowm.xchange.exx.dto.params;

import org.knowm.xchange.currency.CurrencyPair;
import org.knowm.xchange.service.trade.params.TradeHistoryParamCurrencyPair;
import org.knowm.xchange.service.trade.params.TradeHistoryParamOffset;
import org.knowm.xchange.service.trade.params.TradeHistoryParamPaging;
import org.knowm.xchange.service.trade.params.TradeHistoryParamsSorted;

public class EXXTradeHistoryParams
    implements TradeHistoryParamCurrencyPair,
        TradeHistoryParamsSorted,
        TradeHistoryParamOffset,
        TradeHistoryParamPaging {
  private CurrencyPair currencyPair;
  private Order order;
  private Integer offset;
  private Integer pageLength;
  private String orderNoList;

  public EXXTradeHistoryParams(CurrencyPair currencyPair, Integer pageLength) {
    this.currencyPair = currencyPair;
    this.pageLength = pageLength;
  }

  @Override
  public CurrencyPair getCurrencyPair() {
    return currencyPair;
  }

  @Override
  public void setCurrencyPair(CurrencyPair currencyPair) {
    this.currencyPair = currencyPair;
  }

  @Override
  public Order getOrder() {
    return order;
  }

  @Override
  public void setOrder(Order order) {
    this.order = order;
  }

  @Override
  public Long getOffset() {
    return offset == null ? null : Long.valueOf(offset);
  }

  public void setOffset(Long offset) {
    this.offset = offset == null ? null : offset.intValue();
  }

  @Override
  public Integer getPageLength() {
    return pageLength;
  }

  @Override
  public void setPageLength(Integer pageLength) {
    this.pageLength = pageLength;
  }

  @Override
  public Integer getPageNumber() {
    return (offset == null || pageLength == null) ? null : offset / pageLength;
  }

  @Override
  public void setPageNumber(Integer pageNumber) {
    if (pageNumber == null) {
      setOffset(null);
    } else if (pageLength != null) {
      this.offset = pageNumber * pageLength;
    }
  }

  public String getOrderNoList() {
    return orderNoList;
  }

  public void setOrderNoList(String orderNoList) {
    this.orderNoList = orderNoList;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy