org.knowm.xchange.exx.dto.params.EXXTradeHistoryParams Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xchange-exx Show documentation
Show all versions of xchange-exx Show documentation
Development fork. Not for general use.
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;
}
}