Skip to content

Commit

Permalink
use Lombok
Browse files Browse the repository at this point in the history
  • Loading branch information
rizer1980 committed Apr 8, 2024
1 parent 9139f20 commit be4f557
Showing 1 changed file with 4 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import java.util.concurrent.locks.StampedLock;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import lombok.Getter;
import org.knowm.xchange.dto.Order.OrderType;
import org.knowm.xchange.dto.trade.LimitOrder;
import org.knowm.xchange.instrument.Instrument;
Expand All @@ -22,12 +23,15 @@ public final class OrderBook implements Serializable {
private static final long serialVersionUID = -7788306758114464314L;
@JsonIgnore public final StampedLock lock = new StampedLock();
/** the asks */
@Getter
private final List<LimitOrder> asks;

/** the bids */
@Getter
private final List<LimitOrder> bids;

/** the timestamp of the orderbook according to the exchange's server, null if not provided */
@Getter
private Date timeStamp;

/**
Expand Down Expand Up @@ -115,21 +119,6 @@ private static LimitOrder withAmount(LimitOrder limitOrder, BigDecimal tradeable
return new LimitOrder(type, tradeableAmount, instrument, id, date, limit);
}

public Date getTimeStamp() {

return timeStamp;
}

public List<LimitOrder> getAsks() {

return asks;
}

public List<LimitOrder> getBids() {

return bids;
}

public List<LimitOrder> getOrders(OrderType type) {

return type == OrderType.ASK ? asks : bids;
Expand Down

0 comments on commit be4f557

Please sign in to comment.