1+ package com .binance .api .client .domain .event ;
2+
3+ import org .apache .commons .lang3 .builder .ToStringBuilder ;
4+
5+ import com .binance .api .client .constant .BinanceApiConstants ;
6+ import com .fasterxml .jackson .annotation .JsonIgnoreProperties ;
7+ import com .fasterxml .jackson .annotation .JsonProperty ;
8+
9+ /**
10+ * BookTickerEvent event for a symbol. Pushes any update to the best bid or
11+ * ask's price or quantity in real-time for a specified symbol.
12+ */
13+ @ JsonIgnoreProperties (ignoreUnknown = true )
14+ public class BookTickerEvent {
15+
16+ @ JsonProperty ("u" )
17+ private long updateId ;
18+
19+ @ JsonProperty ("s" )
20+ private String symbol ;
21+
22+ @ JsonProperty ("b" )
23+ private String bidPrice ;
24+
25+ @ JsonProperty ("B" )
26+ private String bidQuantity ;
27+
28+ @ JsonProperty ("a" )
29+ private String askPrice ;
30+
31+ @ JsonProperty ("A" )
32+ private String askQuantity ;
33+
34+ public BookTickerEvent () {
35+ super ();
36+ }
37+
38+ public BookTickerEvent (long updateId , String symbol , String bidPrice , String bidQuantity , String askPrice ,
39+ String askQuantity ) {
40+ super ();
41+ this .updateId = updateId ;
42+ this .symbol = symbol ;
43+ this .bidPrice = bidPrice ;
44+ this .bidQuantity = bidQuantity ;
45+ this .askPrice = askPrice ;
46+ this .askQuantity = askQuantity ;
47+ }
48+
49+ public BookTickerEvent (String symbol , String bidPrice , String bidQuantity , String askPrice , String askQuantity ) {
50+ super ();
51+ this .symbol = symbol ;
52+ this .bidPrice = bidPrice ;
53+ this .bidQuantity = bidQuantity ;
54+ this .askPrice = askPrice ;
55+ this .askQuantity = askQuantity ;
56+ }
57+
58+ public long getUpdateId () {
59+ return updateId ;
60+ }
61+
62+ public void setUpdateId (long updateId ) {
63+ this .updateId = updateId ;
64+ }
65+
66+ public String getSymbol () {
67+ return symbol ;
68+ }
69+
70+ public void setSymbol (String symbol ) {
71+ this .symbol = symbol ;
72+ }
73+
74+ public String getBidPrice () {
75+ return bidPrice ;
76+ }
77+
78+ public void setBidPrice (String bidPrice ) {
79+ this .bidPrice = bidPrice ;
80+ }
81+
82+ public String getBidQuantity () {
83+ return bidQuantity ;
84+ }
85+
86+ public void setBidQuantity (String bidQuantity ) {
87+ this .bidQuantity = bidQuantity ;
88+ }
89+
90+ public String getAskPrice () {
91+ return askPrice ;
92+ }
93+
94+ public void setAskPrice (String askPrice ) {
95+ this .askPrice = askPrice ;
96+ }
97+
98+ public String getAskQuantity () {
99+ return askQuantity ;
100+ }
101+
102+ public void setAskQuantity (String askQuantity ) {
103+ this .askQuantity = askQuantity ;
104+ }
105+
106+ @ Override
107+ public String toString () {
108+ return new ToStringBuilder (this , BinanceApiConstants .TO_STRING_BUILDER_STYLE ).append ("eventType" , "BookTicker" )
109+ .append ("updateId" , updateId ).append ("symbol" , symbol ).append ("bidPrice" , bidPrice )
110+ .append ("bidQuantity" , bidQuantity ).append ("askPrice" , askPrice ).append ("askQuantity" , askQuantity )
111+ .toString ();
112+ }
113+ }
0 commit comments