forked from bitrich-info/xchange-stream
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue bitrich-info#561: [HitBTC] OrderBook is missing support of time…
…stamp
- Loading branch information
David Peisakhov
committed
Mar 23, 2020
1 parent
62f6d73
commit d173251
Showing
3 changed files
with
72 additions
and
8 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
...btc/src/main/java/info/bitrich/xchangestream/hitbtc/dto/HitbtcOrderBookWithTimestamp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package info.bitrich.xchangestream.hitbtc.dto; | ||
|
||
import org.knowm.xchange.hitbtc.v2.dto.HitbtcOrderBook; | ||
import org.knowm.xchange.hitbtc.v2.dto.HitbtcOrderLimit; | ||
|
||
import java.util.Date; | ||
|
||
public class HitbtcOrderBookWithTimestamp extends HitbtcOrderBook { | ||
|
||
private final Date timestamp; | ||
|
||
HitbtcOrderBookWithTimestamp(Date timestamp, HitbtcOrderLimit[] asks, HitbtcOrderLimit[] bids) { | ||
super(asks, bids); | ||
this.timestamp = timestamp; | ||
} | ||
|
||
public Date getTimestamp() { | ||
return timestamp; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
StringBuilder asks = new StringBuilder(); | ||
StringBuilder bids = new StringBuilder(); | ||
|
||
for (HitbtcOrderLimit ask : getAsks()) { | ||
asks.append(ask).append(';'); | ||
} | ||
|
||
for (HitbtcOrderLimit bid : getBids()) { | ||
bids.append(bid).append(';'); | ||
} | ||
|
||
return "HitbtcOrderBookWithTimestamp{" + | ||
"asks=" + asks + | ||
", bids=" + bids + | ||
", timestamp=" + timestamp + | ||
'}'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters