|
2 | 2 |
|
3 | 3 | import com.squareup.moshi.Json; |
4 | 4 |
|
| 5 | +/** Order builder, used in order requests. used as a method chain */ |
5 | 6 | @SuppressWarnings("unused") |
6 | 7 | public class OrderBuilder { |
7 | 8 | @Json(name = "client_order_id") |
@@ -33,66 +34,144 @@ public class OrderBuilder { |
33 | 34 | @Json(name = "make_rate") |
34 | 35 | private String makeRate; |
35 | 36 |
|
| 37 | + /** |
| 38 | + * Sets the client order id of the order |
| 39 | + * |
| 40 | + * @param clientOrderId The client order id of the order |
| 41 | + * @return The order builder |
| 42 | + */ |
36 | 43 | public OrderBuilder clientOrderId(String clientOrderId) { |
37 | 44 | this.clientOrderId = clientOrderId; |
38 | 45 | return this; |
39 | 46 | } |
40 | 47 |
|
| 48 | + /** |
| 49 | + * Sets the symbol of the order |
| 50 | + * |
| 51 | + * @param symbol The symbol of the order |
| 52 | + * @return The order builder |
| 53 | + */ |
41 | 54 | public OrderBuilder symbol(String symbol) { |
42 | 55 | this.symbol = symbol; |
43 | 56 | return this; |
44 | 57 | } |
45 | 58 |
|
| 59 | + /** |
| 60 | + * Sets the side of the order |
| 61 | + * |
| 62 | + * @param side The side of the order |
| 63 | + * @return The order builder |
| 64 | + */ |
46 | 65 | public OrderBuilder side(Side side) { |
47 | 66 | this.side = side; |
48 | 67 | return this; |
49 | 68 | } |
50 | 69 |
|
| 70 | + /** |
| 71 | + * Sets the type of the order |
| 72 | + * |
| 73 | + * @param type The type of the order |
| 74 | + * @return The order builder |
| 75 | + */ |
51 | 76 | public OrderBuilder orderType(OrderType type) { |
52 | 77 | this.type = type; |
53 | 78 | return this; |
54 | 79 | } |
55 | 80 |
|
| 81 | + /** |
| 82 | + * Sets the time in force of the order |
| 83 | + * |
| 84 | + * @param timeInForce The time in force of the order |
| 85 | + * @return The order builder |
| 86 | + */ |
56 | 87 | public OrderBuilder timeInForce(TimeInForce timeInForce) { |
57 | 88 | this.timeInForce = timeInForce; |
58 | 89 | return this; |
59 | 90 | } |
60 | 91 |
|
61 | | - public OrderBuilder quantity(String quanity) { |
62 | | - this.quantity = quanity; |
| 92 | + /** |
| 93 | + * Sets the quantity of the order |
| 94 | + * |
| 95 | + * @param quantity The quantity of the order |
| 96 | + * @return The order builder |
| 97 | + */ |
| 98 | + public OrderBuilder quantity(String quantity) { |
| 99 | + this.quantity = quantity; |
63 | 100 | return this; |
64 | 101 | } |
65 | 102 |
|
| 103 | + /** |
| 104 | + * Sets the price of the order |
| 105 | + * |
| 106 | + * @param price The price of the order |
| 107 | + * @return The order builder |
| 108 | + */ |
66 | 109 | public OrderBuilder price(String price) { |
67 | 110 | this.price = price; |
68 | 111 | return this; |
69 | 112 | } |
70 | 113 |
|
| 114 | + /** |
| 115 | + * Sets the stop price of the order |
| 116 | + * |
| 117 | + * @param stopPrice The stop price of the order |
| 118 | + * @return The order builder |
| 119 | + */ |
71 | 120 | public OrderBuilder stopPrice(String stopPrice) { |
72 | 121 | this.stopPrice = stopPrice; |
73 | 122 | return this; |
74 | 123 | } |
75 | 124 |
|
| 125 | + /** |
| 126 | + * Sets the expire time of the order |
| 127 | + * |
| 128 | + * @param expireTime The expire time of the order |
| 129 | + * @return The order builder |
| 130 | + */ |
76 | 131 | public OrderBuilder expireTime(String expireTime) { |
77 | 132 | this.expireTime = expireTime; |
78 | 133 | return this; |
79 | 134 | } |
80 | 135 |
|
| 136 | + /** |
| 137 | + * Sets the strict validate of the order |
| 138 | + * |
| 139 | + * @param strictValidate The strict validate of the order |
| 140 | + * @return The order builder |
| 141 | + */ |
81 | 142 | public OrderBuilder strictValidate(Boolean strictValidate) { |
82 | 143 | this.strictValidate = strictValidate; |
83 | 144 | return this; |
84 | 145 | } |
85 | 146 |
|
| 147 | + /** |
| 148 | + * Sets the post only of the order |
| 149 | + * |
| 150 | + * @param postOnly The post only of the order |
| 151 | + * @return The order builder |
| 152 | + */ |
86 | 153 | public OrderBuilder postOnly(Boolean postOnly) { |
87 | 154 | this.postOnly = postOnly; |
88 | 155 | return this; |
89 | 156 | } |
90 | 157 |
|
| 158 | + /** |
| 159 | + * Sets the take rate of the order |
| 160 | + * |
| 161 | + * @param takeRate The take rate of the order |
| 162 | + * @return The order builder |
| 163 | + */ |
91 | 164 | public OrderBuilder takeRate(String takeRate) { |
92 | 165 | this.takeRate = takeRate; |
93 | 166 | return this; |
94 | 167 | } |
95 | 168 |
|
| 169 | + /** |
| 170 | + * Sets the make rate of the order |
| 171 | + * |
| 172 | + * @param makeRate The make rate of the order |
| 173 | + * @return The order builder |
| 174 | + */ |
96 | 175 | public OrderBuilder makeRate(String makeRate) { |
97 | 176 | this.makeRate = makeRate; |
98 | 177 | return this; |
|
0 commit comments