diff --git a/pom.xml b/pom.xml index 7b23fa74bc0..bbf2b75d9fe 100644 --- a/pom.xml +++ b/pom.xml @@ -32,14 +32,14 @@ 1.8 3.24.2 - 3.12.0 + 3.13.0 2.14.3 3.0 1.7.0 5.9.3 1.18.26 3.8.2 - 1.4.5 + 1.4.11 0.10.2 2.0.6 5.0.0 diff --git a/xchange-ascendex/src/main/java/org/knowm/xchange/ascendex/AscendexAdapters.java b/xchange-ascendex/src/main/java/org/knowm/xchange/ascendex/AscendexAdapters.java index 3a832984c50..f876c877a8c 100644 --- a/xchange-ascendex/src/main/java/org/knowm/xchange/ascendex/AscendexAdapters.java +++ b/xchange-ascendex/src/main/java/org/knowm/xchange/ascendex/AscendexAdapters.java @@ -118,7 +118,7 @@ public static UserTrades adaptUserTrades( ascendexOrderHistoryResponse.forEach( order -> userTrades.add( - new UserTrade.Builder() + UserTrade.builder() .feeAmount(order.getCumFee()) .orderId(order.getOrderId()) .price(order.getPrice()) diff --git a/xchange-bankera/src/main/java/org/knowm/xchange/bankera/BankeraAdapters.java b/xchange-bankera/src/main/java/org/knowm/xchange/bankera/BankeraAdapters.java index 6163244a631..c6de13e9581 100644 --- a/xchange-bankera/src/main/java/org/knowm/xchange/bankera/BankeraAdapters.java +++ b/xchange-bankera/src/main/java/org/knowm/xchange/bankera/BankeraAdapters.java @@ -188,7 +188,7 @@ public static List adaptUserTrades(BankeraUserTrades userTrades) { CurrencyPair pair = new CurrencyPair(currencies[0], currencies[1]); Currency feeCurrency = new Currency(currencies[1]); tradeList.add( - new UserTrade.Builder() + UserTrade.builder() .type(trade.getSide().equalsIgnoreCase("buy") ? OrderType.BID : OrderType.ASK) .originalAmount(new BigDecimal(trade.getAmount())) .currencyPair(pair) diff --git a/xchange-bibox/src/main/java/org/knowm/xchange/bibox/dto/BiboxAdapters.java b/xchange-bibox/src/main/java/org/knowm/xchange/bibox/dto/BiboxAdapters.java index 6d5642fde96..16949fbd0a5 100644 --- a/xchange-bibox/src/main/java/org/knowm/xchange/bibox/dto/BiboxAdapters.java +++ b/xchange-bibox/src/main/java/org/knowm/xchange/bibox/dto/BiboxAdapters.java @@ -144,7 +144,7 @@ public static UserTrades adaptUserTrades(BiboxOrders biboxOrderHistory) { } private static UserTrade adaptUserTrade(BiboxOrder order) { - return new UserTrade.Builder() + return UserTrade.builder() .orderId(order.getId()) .id(order.getId()) .currencyPair(new CurrencyPair(order.getCoinSymbol(), order.getCurrencySymbol())) diff --git a/xchange-binance/src/main/java/org/knowm/xchange/binance/BinanceAdapters.java b/xchange-binance/src/main/java/org/knowm/xchange/binance/BinanceAdapters.java index 31301908478..8c6f93db342 100644 --- a/xchange-binance/src/main/java/org/knowm/xchange/binance/BinanceAdapters.java +++ b/xchange-binance/src/main/java/org/knowm/xchange/binance/BinanceAdapters.java @@ -376,7 +376,7 @@ public static UserTrades adaptUserTrades(List binanceTrades, boole binanceTrades.stream() .map( t -> - new UserTrade.Builder() + UserTrade.builder() .type(BinanceAdapters.convertType(t.isBuyer)) .originalAmount(t.qty) .instrument(adaptSymbol(t.symbol, isFuture)) diff --git a/xchange-bitbay/src/main/java/org/knowm/xchange/bitbay/BitbayAdapters.java b/xchange-bitbay/src/main/java/org/knowm/xchange/bitbay/BitbayAdapters.java index 26815805553..000bafe6bcd 100644 --- a/xchange-bitbay/src/main/java/org/knowm/xchange/bitbay/BitbayAdapters.java +++ b/xchange-bitbay/src/main/java/org/knowm/xchange/bitbay/BitbayAdapters.java @@ -206,7 +206,7 @@ private static UserTrade createUserTrade(BitbayOrder bitbayOrder) { throw new IllegalArgumentException(e); } - return new UserTrade.Builder() + return UserTrade.builder() .type(type) .originalAmount(bitbayOrder.getAmount()) .currencyPair(currencyPair) @@ -244,7 +244,7 @@ public static List adaptTransactions(List response) { String id = (type + "_" + date + "_" + market).replaceAll("\\s+", ""); trades.add( - new UserTrade.Builder() + UserTrade.builder() .type(orderType) .originalAmount(amount) .currencyPair(pair) diff --git a/xchange-bitbay/src/main/java/org/knowm/xchange/bitbay/v3/BitbayAdapters.java b/xchange-bitbay/src/main/java/org/knowm/xchange/bitbay/v3/BitbayAdapters.java index da16c02048d..78eda1692b2 100644 --- a/xchange-bitbay/src/main/java/org/knowm/xchange/bitbay/v3/BitbayAdapters.java +++ b/xchange-bitbay/src/main/java/org/knowm/xchange/bitbay/v3/BitbayAdapters.java @@ -36,7 +36,7 @@ public static UserTrades adaptUserTrades(BitbayUserTrades response) { new CurrencyPair(Currency.getInstance(parts[0]), Currency.getInstance(parts[1])); Date timestamp = new Date(trade.getTime()); trades.add( - new UserTrade.Builder() + UserTrade.builder() .id(trade.getId().toString()) .type(orderType) .originalAmount(trade.getAmount()) diff --git a/xchange-bitcoinde/src/main/java/org/knowm/xchange/bitcoinde/v4/BitcoindeAdapters.java b/xchange-bitcoinde/src/main/java/org/knowm/xchange/bitcoinde/v4/BitcoindeAdapters.java index c5999c2a92b..37ae103973b 100644 --- a/xchange-bitcoinde/src/main/java/org/knowm/xchange/bitcoinde/v4/BitcoindeAdapters.java +++ b/xchange-bitcoinde/src/main/java/org/knowm/xchange/bitcoinde/v4/BitcoindeAdapters.java @@ -394,7 +394,7 @@ public static UserTrades adaptTradeHistory( : trade.getCreatedAt(); result.add( - new UserTrade.Builder() + UserTrade.builder() .id(trade.getTradeId()) .timestamp(timestamp) .currencyPair(trade.getTradingPair()) diff --git a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/service/BitfinexAdapters.java b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/service/BitfinexAdapters.java index 6690dd6e279..e5fbc54cf89 100644 --- a/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/service/BitfinexAdapters.java +++ b/xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/service/BitfinexAdapters.java @@ -582,7 +582,7 @@ public static UserTrades adaptTradeHistory(BitfinexTradeResponse[] trades, Strin Date timestamp = convertBigDecimalTimestampToDate(trade.getTimestamp()); final BigDecimal fee = trade.getFeeAmount() == null ? null : trade.getFeeAmount().negate(); pastTrades.add( - new UserTrade.Builder() + UserTrade.builder() .type(orderType) .originalAmount(trade.getAmount()) .currencyPair(currencyPair) @@ -611,7 +611,7 @@ public static UserTrades adaptTradeHistoryV2( : trade.getExecAmount(); final BigDecimal fee = trade.getFee() != null ? trade.getFee().negate() : null; pastTrades.add( - new UserTrade.Builder() + UserTrade.builder() .type(orderType) .originalAmount(amount) .currencyPair(adaptCurrencyPair(trade.getSymbol())) diff --git a/xchange-bithumb/src/main/java/org/knowm/xchange/bithumb/BithumbAdapters.java b/xchange-bithumb/src/main/java/org/knowm/xchange/bithumb/BithumbAdapters.java index 25ce1b558c6..cb96113f528 100644 --- a/xchange-bithumb/src/main/java/org/knowm/xchange/bithumb/BithumbAdapters.java +++ b/xchange-bithumb/src/main/java/org/knowm/xchange/bithumb/BithumbAdapters.java @@ -179,7 +179,7 @@ public static UserTrades adaptUserTrades( private static UserTrade adaptUserTrade( BithumbUserTransaction bithumbTransaction, CurrencyPair currencyPair) { - return new UserTrade.Builder() + return UserTrade.builder() .currencyPair(currencyPair) .originalAmount(bithumbTransaction.getUnits()) .type(adaptTransactionSearch(bithumbTransaction.getSearch())) diff --git a/xchange-bitmex/src/main/java/org/knowm/xchange/bitmex/BitmexAdapters.java b/xchange-bitmex/src/main/java/org/knowm/xchange/bitmex/BitmexAdapters.java index ede595c8ddb..8d1efece26f 100644 --- a/xchange-bitmex/src/main/java/org/knowm/xchange/bitmex/BitmexAdapters.java +++ b/xchange-bitmex/src/main/java/org/knowm/xchange/bitmex/BitmexAdapters.java @@ -354,7 +354,7 @@ public static UserTrade adoptUserTrade(BitmexPrivateExecution exec) { OrderType orderType = convertType(exec.side); return orderType == null ? null - : new UserTrade.Builder() + : UserTrade.builder() .id(exec.execID) .orderId(exec.orderID) .currencyPair(pair) diff --git a/xchange-bitso/src/main/java/org/knowm/xchange/bitso/BitsoAdapters.java b/xchange-bitso/src/main/java/org/knowm/xchange/bitso/BitsoAdapters.java index 0c9fca6b870..561dfc83d96 100644 --- a/xchange-bitso/src/main/java/org/knowm/xchange/bitso/BitsoAdapters.java +++ b/xchange-bitso/src/main/java/org/knowm/xchange/bitso/BitsoAdapters.java @@ -171,7 +171,7 @@ public static UserTrades adaptTradeHistory(BitsoUserTransaction[] bitsoUserTrans String feeCurrency = sell ? currencyPair.counter.getCurrencyCode() : currencyPair.base.getCurrencyCode(); UserTrade trade = - new UserTrade.Builder() + UserTrade.builder() .type(orderType) .originalAmount(originalAmount) .currencyPair(currencyPair) diff --git a/xchange-bitstamp/src/main/java/org/knowm/xchange/bitstamp/BitstampAdapters.java b/xchange-bitstamp/src/main/java/org/knowm/xchange/bitstamp/BitstampAdapters.java index 48bb0455c03..f67c133de9e 100644 --- a/xchange-bitstamp/src/main/java/org/knowm/xchange/bitstamp/BitstampAdapters.java +++ b/xchange-bitstamp/src/main/java/org/knowm/xchange/bitstamp/BitstampAdapters.java @@ -234,7 +234,7 @@ public static UserTrades adaptTradeHistory(BitstampUserTransaction[] bitstampUse final CurrencyPair pair = new CurrencyPair(t.getBaseCurrency().toUpperCase(), t.getCounterCurrency().toUpperCase()); UserTrade trade = - new UserTrade.Builder() + UserTrade.builder() .type(orderType) .originalAmount(t.getBaseAmount().abs()) .currencyPair(pair) @@ -425,6 +425,7 @@ public static InstrumentMetaData adaptCurrencyPairInfo(BitstampPairInfo pairInfo .counterMinimumAmount(minOrder) .priceScale(pairInfo.getCounterDecimals()) .volumeScale(pairInfo.getBaseDecimals()) + .marketOrderEnabled(pairInfo.isMarketOrdersEnabled()) .build(); } diff --git a/xchange-bitstamp/src/main/java/org/knowm/xchange/bitstamp/dto/marketdata/BitstampPairInfo.java b/xchange-bitstamp/src/main/java/org/knowm/xchange/bitstamp/dto/marketdata/BitstampPairInfo.java index 63550380393..f5a1a0d9fc1 100644 --- a/xchange-bitstamp/src/main/java/org/knowm/xchange/bitstamp/dto/marketdata/BitstampPairInfo.java +++ b/xchange-bitstamp/src/main/java/org/knowm/xchange/bitstamp/dto/marketdata/BitstampPairInfo.java @@ -31,4 +31,10 @@ public class BitstampPairInfo { @JsonProperty("description") String description; + @JsonProperty("instant_and_market_orders") + String instantAndMarketOrders; + + public boolean isMarketOrdersEnabled(){ + return "Enabled".equals(instantAndMarketOrders); + } } diff --git a/xchange-bittrex/src/main/java/org/knowm/xchange/bittrex/BittrexAdapters.java b/xchange-bittrex/src/main/java/org/knowm/xchange/bittrex/BittrexAdapters.java index 436e81272e6..3bbc3eed23d 100644 --- a/xchange-bittrex/src/main/java/org/knowm/xchange/bittrex/BittrexAdapters.java +++ b/xchange-bittrex/src/main/java/org/knowm/xchange/bittrex/BittrexAdapters.java @@ -146,7 +146,7 @@ public static List adaptUserTrades(List bittrexUserTrad return bittrexUserTrades.stream() .map( bittrexOrder -> - new UserTrade.Builder() + UserTrade.builder() .type( BittrexConstants.BUY.equalsIgnoreCase(bittrexOrder.getDirection()) ? OrderType.BID diff --git a/xchange-bity/src/main/java/org/knowm/xchange/bity/BityAdapters.java b/xchange-bity/src/main/java/org/knowm/xchange/bity/BityAdapters.java index 8614b2738dc..cbe1314a31f 100644 --- a/xchange-bity/src/main/java/org/knowm/xchange/bity/BityAdapters.java +++ b/xchange-bity/src/main/java/org/knowm/xchange/bity/BityAdapters.java @@ -56,7 +56,7 @@ public static UserTrade adaptTrade(BityOrder order) { Date date = order.getTimestampCreated(); String orderId = order.getResourceUri(); - return new UserTrade.Builder() + return UserTrade.builder() .type(orderType) .originalAmount(amount) .currencyPair(currencyPair) diff --git a/xchange-bl3p/src/main/java/org/knowm/xchange/bl3p/Bl3pAdapters.java b/xchange-bl3p/src/main/java/org/knowm/xchange/bl3p/Bl3pAdapters.java index a98064816bc..b7fb92b53bc 100644 --- a/xchange-bl3p/src/main/java/org/knowm/xchange/bl3p/Bl3pAdapters.java +++ b/xchange-bl3p/src/main/java/org/knowm/xchange/bl3p/Bl3pAdapters.java @@ -86,7 +86,7 @@ public static List adaptUserTransactionsToUserTrades( for (Bl3pUserTransactions.Bl3pUserTransaction t : transactions) { UserTrade ut = - new UserTrade.Builder() + UserTrade.builder() .currencyPair(CurrencyPair.BTC_EUR) .id(Integer.toString(t.id)) .orderId(Integer.toString(t.orderId)) diff --git a/xchange-bleutrade/src/main/java/org/knowm/xchange/bleutrade/BleutradeAdapters.java b/xchange-bleutrade/src/main/java/org/knowm/xchange/bleutrade/BleutradeAdapters.java index db7d02229e8..22732ba4bdb 100644 --- a/xchange-bleutrade/src/main/java/org/knowm/xchange/bleutrade/BleutradeAdapters.java +++ b/xchange-bleutrade/src/main/java/org/knowm/xchange/bleutrade/BleutradeAdapters.java @@ -184,7 +184,7 @@ public static ExchangeMetaData adaptToExchangeMetaData( public static UserTrade adaptUserTrade(BluetradeExecutedTrade trade) { OrderType orderType = trade.type.equalsIgnoreCase("sell") ? OrderType.ASK : OrderType.BID; CurrencyPair currencyPair = BleutradeUtils.toCurrencyPair(trade.exchange); - return new UserTrade.Builder() + return UserTrade.builder() .type(orderType) .originalAmount(trade.quantity) .currencyPair(currencyPair) diff --git a/xchange-blockchain/src/main/java/org/knowm/xchange/blockchain/BlockchainAdapters.java b/xchange-blockchain/src/main/java/org/knowm/xchange/blockchain/BlockchainAdapters.java index ce415765960..fc4f1e11e06 100644 --- a/xchange-blockchain/src/main/java/org/knowm/xchange/blockchain/BlockchainAdapters.java +++ b/xchange-blockchain/src/main/java/org/knowm/xchange/blockchain/BlockchainAdapters.java @@ -212,7 +212,7 @@ private static String generateClOrdId() { public static UserTrades toUserTrades(List blockchainTrades) { List trades = blockchainTrades.stream() - .map(blockchainTrade -> new UserTrade.Builder() + .map(blockchainTrade -> UserTrade.builder() .type(blockchainTrade.getOrderType()) .originalAmount(blockchainTrade.getCumQty()) .currencyPair(blockchainTrade.getSymbol()) diff --git a/xchange-btcmarkets/src/main/java/org/knowm/xchange/btcmarkets/BTCMarketsAdapters.java b/xchange-btcmarkets/src/main/java/org/knowm/xchange/btcmarkets/BTCMarketsAdapters.java index 2ceec8877a6..039a737d863 100644 --- a/xchange-btcmarkets/src/main/java/org/knowm/xchange/btcmarkets/BTCMarketsAdapters.java +++ b/xchange-btcmarkets/src/main/java/org/knowm/xchange/btcmarkets/BTCMarketsAdapters.java @@ -152,7 +152,7 @@ public static UserTrade adaptTrade(BTCMarketsUserTrade trade, CurrencyPair curre final String tradeId = Long.toString(trade.getId()); final Long orderId = trade.getOrderId(); final String feeCurrency = currencyPair.counter.getCurrencyCode(); - return new UserTrade.Builder() + return UserTrade.builder() .type(type) .originalAmount(trade.getVolume()) .currencyPair(currencyPair) @@ -172,7 +172,7 @@ public static UserTrade adaptTradeHistory(BTCMarketsTradeHistoryResponse trade) final String orderId = trade.orderId; final String feeCurrency = currencyPair.counter.getCurrencyCode(); try { - return new UserTrade.Builder() + return UserTrade.builder() .type(type) .originalAmount(trade.amount) .currencyPair(currencyPair) diff --git a/xchange-btcmarkets/src/test/java/org/knowm/xchange/btcmarkets/service/BTCMarketsTestSupport.java b/xchange-btcmarkets/src/test/java/org/knowm/xchange/btcmarkets/service/BTCMarketsTestSupport.java index 8f7c82db878..7002f5f7e51 100644 --- a/xchange-btcmarkets/src/test/java/org/knowm/xchange/btcmarkets/service/BTCMarketsTestSupport.java +++ b/xchange-btcmarkets/src/test/java/org/knowm/xchange/btcmarkets/service/BTCMarketsTestSupport.java @@ -157,7 +157,7 @@ protected static LimitOrder[] expectedOrders() { protected static UserTrade[] expectedUserTrades() { return new UserTrade[] { - new UserTrade.Builder() + UserTrade.builder() .type(Order.OrderType.ASK) .originalAmount(new BigDecimal("20.00000000")) .currencyPair(CurrencyPair.BTC_AUD) @@ -167,7 +167,7 @@ protected static UserTrade[] expectedUserTrades() { .feeAmount(BigDecimal.ONE) .feeCurrency(Currency.AUD) .build(), - new UserTrade.Builder() + UserTrade.builder() .type(Order.OrderType.ASK) .originalAmount(new BigDecimal("40.00000000")) .currencyPair(CurrencyPair.BTC_AUD) @@ -177,7 +177,7 @@ protected static UserTrade[] expectedUserTrades() { .feeAmount(BigDecimal.valueOf(2)) .feeCurrency(Currency.AUD) .build(), - new UserTrade.Builder() + UserTrade.builder() .type(Order.OrderType.BID) .originalAmount(new BigDecimal("60.00000000")) .currencyPair(CurrencyPair.BTC_AUD) @@ -187,7 +187,7 @@ protected static UserTrade[] expectedUserTrades() { .feeAmount(BigDecimal.valueOf(3)) .feeCurrency(Currency.AUD) .build(), - new UserTrade.Builder() + UserTrade.builder() .type(Order.OrderType.BID) .originalAmount(new BigDecimal("80.00000000")) .currencyPair(CurrencyPair.BTC_AUD) @@ -197,7 +197,7 @@ protected static UserTrade[] expectedUserTrades() { .feeAmount(BigDecimal.valueOf(4)) .feeCurrency(Currency.AUD) .build(), - new UserTrade.Builder() + UserTrade.builder() .type(Order.OrderType.BID) .originalAmount(BigDecimal.ZERO) .currencyPair(CurrencyPair.BTC_AUD) diff --git a/xchange-btcturk/src/main/java/org/knowm/xchange/btcturk/service/BTCTurkTradeService.java b/xchange-btcturk/src/main/java/org/knowm/xchange/btcturk/service/BTCTurkTradeService.java index 47fe1d491b8..58c25951abd 100644 --- a/xchange-btcturk/src/main/java/org/knowm/xchange/btcturk/service/BTCTurkTradeService.java +++ b/xchange-btcturk/src/main/java/org/knowm/xchange/btcturk/service/BTCTurkTradeService.java @@ -93,7 +93,7 @@ public UserTrades getTradeHistory(TradeHistoryParams params) throws IOException for (BTCTurkUserTransactions transaction : transactions) { if (transaction.getOperation().equals(BTCTurkOperations.trade)) trades.add( - new UserTrade.Builder() + UserTrade.builder() .type( ((transaction.getAmount().compareTo(BigDecimal.ZERO) > 0) ? OrderType.ASK diff --git a/xchange-ccex/src/main/java/org/knowm/xchange/ccex/CCEXAdapters.java b/xchange-ccex/src/main/java/org/knowm/xchange/ccex/CCEXAdapters.java index 9b03dd5055f..b05db84aca2 100644 --- a/xchange-ccex/src/main/java/org/knowm/xchange/ccex/CCEXAdapters.java +++ b/xchange-ccex/src/main/java/org/knowm/xchange/ccex/CCEXAdapters.java @@ -228,7 +228,7 @@ public static UserTrade adaptUserTrade(CCEXOrderhistory trade) { price = trade.getLimit(); } - return new UserTrade.Builder() + return UserTrade.builder() .type(orderType) .originalAmount(amount) .currencyPair(currencyPair) diff --git a/xchange-cexio/src/main/java/org/knowm/xchange/cexio/CexIOAdapters.java b/xchange-cexio/src/main/java/org/knowm/xchange/cexio/CexIOAdapters.java index a50dea8bdda..d87a9ccc514 100644 --- a/xchange-cexio/src/main/java/org/knowm/xchange/cexio/CexIOAdapters.java +++ b/xchange-cexio/src/main/java/org/knowm/xchange/cexio/CexIOAdapters.java @@ -238,7 +238,7 @@ public static UserTrade adaptArchivedOrder(CexIOArchivedOrder cexIOArchivedOrder : Currency.getInstance(cexIOArchivedOrder.feeCcy); BigDecimal fee = cexIOArchivedOrder.feeValue; - return new UserTrade.Builder() + return UserTrade.builder() .type(orderType) .originalAmount(originalAmount) .currencyPair(currencyPair) diff --git a/xchange-coinbase/src/main/java/org/knowm/xchange/coinbase/CoinbaseAdapters.java b/xchange-coinbase/src/main/java/org/knowm/xchange/coinbase/CoinbaseAdapters.java index 0647818a579..d06f09716cf 100644 --- a/xchange-coinbase/src/main/java/org/knowm/xchange/coinbase/CoinbaseAdapters.java +++ b/xchange-coinbase/src/main/java/org/knowm/xchange/coinbase/CoinbaseAdapters.java @@ -57,7 +57,7 @@ public static UserTrades adaptTrades(List transactions, OrderTy } private static UserTrade adaptTrade(CoinbaseBuySell transaction, OrderType orderType) { - return new UserTrade.Builder() + return UserTrade.builder() .type(orderType) .originalAmount(transaction.getAmount().getAmount()) .currencyPair( @@ -101,7 +101,7 @@ public static UserTrade adaptTrade(CoinbaseTransfer transfer) { final BigDecimal feeAmount = transfer.getCoinbaseFee().getAmount(); final String feeCurrency = transfer.getCoinbaseFee().getCurrency(); - return new UserTrade.Builder() + return UserTrade.builder() .type(orderType) .originalAmount(originalAmount) .currencyPair(new CurrencyPair(tradableIdentifier, transactionCurrency)) diff --git a/xchange-coinbase/src/test/java/org/knowm/xchange/coinbase/CoinbaseAdapterTest.java b/xchange-coinbase/src/test/java/org/knowm/xchange/coinbase/CoinbaseAdapterTest.java index 0b5745eecd7..acceaefc398 100644 --- a/xchange-coinbase/src/test/java/org/knowm/xchange/coinbase/CoinbaseAdapterTest.java +++ b/xchange-coinbase/src/test/java/org/knowm/xchange/coinbase/CoinbaseAdapterTest.java @@ -66,7 +66,7 @@ public void testAdaptTrades() throws IOException { BigDecimal price = new BigDecimal("905.10").divide(originalAmount, RoundingMode.HALF_EVEN); UserTrade expectedTrade = - new UserTrade.Builder() + UserTrade.builder() .type(OrderType.BID) .originalAmount(originalAmount) .currencyPair(CurrencyPair.BTC_USD) diff --git a/xchange-coinbasepro/src/main/java/org/knowm/xchange/coinbasepro/CoinbaseProAdapters.java b/xchange-coinbasepro/src/main/java/org/knowm/xchange/coinbasepro/CoinbaseProAdapters.java index 786ca280da8..016f2ec9faa 100644 --- a/xchange-coinbasepro/src/main/java/org/knowm/xchange/coinbasepro/CoinbaseProAdapters.java +++ b/xchange-coinbasepro/src/main/java/org/knowm/xchange/coinbasepro/CoinbaseProAdapters.java @@ -309,7 +309,7 @@ public static UserTrades adaptTradeHistory(List coinbaseExFills CurrencyPair currencyPair = new CurrencyPair(fill.getProductId().replace('-', '/')); trades.add( - new UserTrade.Builder() + UserTrade.builder() .type("buy".equals(fill.getSide()) ? OrderType.BID : OrderType.ASK) .originalAmount(fill.getSize()) .currencyPair(currencyPair) diff --git a/xchange-coindeal/src/main/java/org/knowm/xchange/coindeal/CoindealAdapters.java b/xchange-coindeal/src/main/java/org/knowm/xchange/coindeal/CoindealAdapters.java index 368bc230e35..411dce6c5a3 100644 --- a/xchange-coindeal/src/main/java/org/knowm/xchange/coindeal/CoindealAdapters.java +++ b/xchange-coindeal/src/main/java/org/knowm/xchange/coindeal/CoindealAdapters.java @@ -32,7 +32,7 @@ public static UserTrades adaptToUserTrades(List coindealTr CurrencyPair currencyPair = CurrencyPairDeserializer.getCurrencyPairFromString(coindealTradeHistory.getSymbol()); userTrades.add( - new UserTrade.Builder() + UserTrade.builder() .type( (coindealTradeHistory.getSide().equals("BUY")) ? Order.OrderType.BID diff --git a/xchange-coindirect/src/main/java/org/knowm/xchange/coindirect/service/CoindirectTradeService.java b/xchange-coindirect/src/main/java/org/knowm/xchange/coindirect/service/CoindirectTradeService.java index 6e324ba718a..48a596bd8c1 100644 --- a/xchange-coindirect/src/main/java/org/knowm/xchange/coindirect/service/CoindirectTradeService.java +++ b/xchange-coindirect/src/main/java/org/knowm/xchange/coindirect/service/CoindirectTradeService.java @@ -97,7 +97,7 @@ public UserTrades getTradeHistory(TradeHistoryParams params) throws IOException if (t.executedAmount == null || t.executedAmount.signum() == 0) { return null; } - return new UserTrade.Builder() + return UserTrade.builder() .type(CoindirectAdapters.convert(t.side)) .originalAmount(t.executedAmount) .currencyPair(CoindirectAdapters.toCurrencyPair(t.symbol)) diff --git a/xchange-coinegg/src/main/java/org/knowm/xchange/coinegg/CoinEggAdapters.java b/xchange-coinegg/src/main/java/org/knowm/xchange/coinegg/CoinEggAdapters.java index 44d2aba3523..9191405211d 100644 --- a/xchange-coinegg/src/main/java/org/knowm/xchange/coinegg/CoinEggAdapters.java +++ b/xchange-coinegg/src/main/java/org/knowm/xchange/coinegg/CoinEggAdapters.java @@ -140,7 +140,7 @@ public static UserTrades adaptTradeHistory(CoinEggTradeView coinEggTradeView) { .timestamp(coinEggTradeView.getDateTime()) .build(); - trades.add((UserTrade) UserTrade.Builder.from(trade).build()); + trades.add((UserTrade) UserTrade.builder().from(trade).build()); return new UserTrades(trades, null); } diff --git a/xchange-coinfloor/src/main/java/org/knowm/xchange/coinfloor/CoinfloorAdapters.java b/xchange-coinfloor/src/main/java/org/knowm/xchange/coinfloor/CoinfloorAdapters.java index 5ec6d582e88..20d3fb10410 100644 --- a/xchange-coinfloor/src/main/java/org/knowm/xchange/coinfloor/CoinfloorAdapters.java +++ b/xchange-coinfloor/src/main/java/org/knowm/xchange/coinfloor/CoinfloorAdapters.java @@ -129,7 +129,7 @@ public static UserTrades adaptTradeHistory(Collection final BigDecimal feeAmount = transaction.getFee(); UserTrade trade = - new UserTrade.Builder() + UserTrade.builder() .type(transaction.getSide()) .originalAmount(transaction.getAmount().abs()) .currencyPair(transaction.getCurrencyPair()) diff --git a/xchange-coingi/src/main/java/org/knowm/xchange/coingi/CoingiAdapters.java b/xchange-coingi/src/main/java/org/knowm/xchange/coingi/CoingiAdapters.java index a7202cee6e0..659e47d7160 100644 --- a/xchange-coingi/src/main/java/org/knowm/xchange/coingi/CoingiAdapters.java +++ b/xchange-coingi/src/main/java/org/knowm/xchange/coingi/CoingiAdapters.java @@ -209,7 +209,7 @@ public static UserTrades adaptTradeHistory(CoingiOrdersList ordersList) { o.getCurrencyPair().get("counter").toUpperCase()); UserTrade trade = - new UserTrade.Builder() + UserTrade.builder() .type(orderType) .originalAmount(o.getOriginalBaseAmount()) .currencyPair(pair) diff --git a/xchange-coinjar/src/main/java/org/knowm/xchange/coinjar/CoinjarAdapters.java b/xchange-coinjar/src/main/java/org/knowm/xchange/coinjar/CoinjarAdapters.java index 1fa616466cf..3bb5fd31364 100644 --- a/xchange-coinjar/src/main/java/org/knowm/xchange/coinjar/CoinjarAdapters.java +++ b/xchange-coinjar/src/main/java/org/knowm/xchange/coinjar/CoinjarAdapters.java @@ -130,7 +130,7 @@ public static LimitOrder adaptOrderToLimitOrder(CoinjarOrder coinjarOrder) { } public static UserTrade adaptOrderToUserTrade(CoinjarOrder order) { - return new UserTrade.Builder() + return UserTrade.builder() .id(order.oid.toString()) .orderId(order.oid.toString()) .currencyPair(productToCurrencyPair(order.productId)) @@ -165,7 +165,7 @@ public static OrderBook adaptOrderbook(CoinjarOrderBook orderBook, CurrencyPair } public static UserTrade adaptFillToUserTrade(CoinjarFill coinjarFill) { - return new UserTrade.Builder() + return UserTrade.builder() .id(coinjarFill.tid.toString()) .orderId(coinjarFill.oid.toString()) .currencyPair(productToCurrencyPair(coinjarFill.productId)) diff --git a/xchange-coinjar/src/test/java/org/knowm/xchange/coinjar/CoinjarAdaptersTest.java b/xchange-coinjar/src/test/java/org/knowm/xchange/coinjar/CoinjarAdaptersTest.java index c2f3f9c864e..1bdd70809bb 100644 --- a/xchange-coinjar/src/test/java/org/knowm/xchange/coinjar/CoinjarAdaptersTest.java +++ b/xchange-coinjar/src/test/java/org/knowm/xchange/coinjar/CoinjarAdaptersTest.java @@ -62,7 +62,7 @@ public void testAdaptOrderToUserTrade() { "2017-10-12T15:39:27.000+11:00"); final UserTrade expected = - new UserTrade.Builder() + UserTrade.builder() .id("3267") .orderId("3267") .currencyPair(CurrencyPair.BTC_AUD) diff --git a/xchange-coinmate/src/main/java/org/knowm/xchange/coinmate/CoinmateAdapters.java b/xchange-coinmate/src/main/java/org/knowm/xchange/coinmate/CoinmateAdapters.java index c5da51099f8..f5a46d53a48 100644 --- a/xchange-coinmate/src/main/java/org/knowm/xchange/coinmate/CoinmateAdapters.java +++ b/xchange-coinmate/src/main/java/org/knowm/xchange/coinmate/CoinmateAdapters.java @@ -191,7 +191,7 @@ public static Wallet adaptWallet(CoinmateBalance coinmateBalance) { public static UserTrades adaptTransactionHistory( CoinmateTransactionHistory coinmateTradeHistory) { List trades = coinmateTradeHistory.getData().stream().map( - entry -> new UserTrade.Builder() + entry -> UserTrade.builder() .type(typeToOrderTypeOrNull(entry.getTransactionType())) .originalAmount(entry.getAmount()) .currencyPair( @@ -210,7 +210,7 @@ public static UserTrades adaptTransactionHistory( } public static UserTrades adaptTradeHistory(CoinmateTradeHistory coinmateTradeHistory) { - List trades = coinmateTradeHistory.getData().stream().map(entry -> new UserTrade.Builder() + List trades = coinmateTradeHistory.getData().stream().map(entry -> UserTrade.builder() .type(typeToOrderTypeOrNull(entry.getType())) .originalAmount(entry.getAmount()) .currencyPair(CoinmateUtils.getPair(entry.getCurrencyPair())) diff --git a/xchange-core/src/test/java/org/knowm/xchange/dto/trade/UserTradeTest.java b/xchange-core/src/test/java/org/knowm/xchange/dto/trade/UserTradeTest.java index f7feaeb3e19..282279ab445 100644 --- a/xchange-core/src/test/java/org/knowm/xchange/dto/trade/UserTradeTest.java +++ b/xchange-core/src/test/java/org/knowm/xchange/dto/trade/UserTradeTest.java @@ -29,7 +29,7 @@ public void testBuilder() { final String orderUserReference = "orderUserReference"; final UserTrade copy = - new UserTrade.Builder() + UserTrade.builder() .type(type) .originalAmount(originalAmount) .currencyPair(currencyPair) @@ -67,7 +67,7 @@ public void testBuilderFrom() { final Currency feeCurrency = Currency.BTC; final UserTrade original = - new UserTrade.Builder() + UserTrade.builder() .type(type) .originalAmount(originalAmount) .currencyPair(currencyPair) @@ -79,7 +79,7 @@ public void testBuilderFrom() { .feeCurrency(feeCurrency) .build(); - final UserTrade copy = UserTrade.Builder.from(original).build(); + final UserTrade copy = UserTrade.builder().from(original).build(); assertThat(copy.getType()).isEqualTo(original.getType()); assertThat(copy.getOriginalAmount()).isEqualTo(original.getOriginalAmount()); @@ -104,7 +104,7 @@ public void testSerializeDeserialize() throws IOException { final BigDecimal feeAmount = new BigDecimal("0"); final Currency feeCurrency = Currency.BTC; final UserTrade original = - new UserTrade.Builder() + UserTrade.builder() .type(type) .originalAmount(originalAmount) .currencyPair(currencyPair) @@ -136,7 +136,7 @@ public void returnsEqualsCorrectlyWithEqualUserTrades() { final Currency feeCurrency = Currency.BTC; final UserTrade original = - new UserTrade.Builder() + UserTrade.builder() .type(type) .originalAmount(originalAmount) .currencyPair(currencyPair) @@ -148,7 +148,7 @@ public void returnsEqualsCorrectlyWithEqualUserTrades() { .feeCurrency(feeCurrency) .build(); final UserTrade copy = - new UserTrade.Builder() + UserTrade.builder() .type(type) .originalAmount(originalAmount) .currencyPair(currencyPair) @@ -173,7 +173,7 @@ public void returnsEqualsCorrectlyWithUnequalUserTradesOfUserTradeAttributes() { final String id = "id"; final UserTrade original = - new UserTrade.Builder() + UserTrade.builder() .type(type) .originalAmount(originalAmount) .currencyPair(currencyPair) @@ -186,7 +186,7 @@ public void returnsEqualsCorrectlyWithUnequalUserTradesOfUserTradeAttributes() { .build(); final UserTrade copy = - new UserTrade.Builder() + UserTrade.builder() .type(type) .originalAmount(originalAmount) .currencyPair(currencyPair) @@ -210,7 +210,7 @@ public void returnsEqualsCorrectlyWithUnequalUserTradesOfTradeAttributes() { final Date timestamp = new Date(); final UserTrade original = - new UserTrade.Builder() + UserTrade.builder() .type(type) .originalAmount(originalAmount) .currencyPair(currencyPair) @@ -223,7 +223,7 @@ public void returnsEqualsCorrectlyWithUnequalUserTradesOfTradeAttributes() { .build(); final UserTrade copy = - new UserTrade.Builder() + UserTrade.builder() .type(type) .originalAmount(originalAmount) .currencyPair(currencyPair) diff --git a/xchange-core/src/test/java/org/knowm/xchange/dto/trade/UserTradesTest.java b/xchange-core/src/test/java/org/knowm/xchange/dto/trade/UserTradesTest.java index 6c095163fc1..e4085d57cb9 100644 --- a/xchange-core/src/test/java/org/knowm/xchange/dto/trade/UserTradesTest.java +++ b/xchange-core/src/test/java/org/knowm/xchange/dto/trade/UserTradesTest.java @@ -19,14 +19,14 @@ public void userTradesJsonMarchallTest() throws JsonProcessingException { List userTradeList = new ArrayList<>(); userTradeList.add( - new UserTrade.Builder() + UserTrade.builder() .timestamp(Date.from(Instant.now())) .currencyPair(CurrencyPair.BTC_USD) .price(BigDecimal.ONE) .originalAmount(BigDecimal.ONE) .build()); userTradeList.add( - new UserTrade.Builder() + UserTrade.builder() .timestamp(Date.from(Instant.now())) .currencyPair(CurrencyPair.BTC_USD) .id("id") @@ -34,7 +34,7 @@ public void userTradesJsonMarchallTest() throws JsonProcessingException { .originalAmount(BigDecimal.ONE) .build()); userTradeList.add( - new UserTrade.Builder() + UserTrade.builder() .timestamp(Date.from(Instant.now())) .currencyPair(CurrencyPair.BTC_USD) .id("id") diff --git a/xchange-deribit/src/main/java/org/knowm/xchange/deribit/v2/DeribitAdapters.java b/xchange-deribit/src/main/java/org/knowm/xchange/deribit/v2/DeribitAdapters.java index 4ff61f8e792..effbd11cb10 100644 --- a/xchange-deribit/src/main/java/org/knowm/xchange/deribit/v2/DeribitAdapters.java +++ b/xchange-deribit/src/main/java/org/knowm/xchange/deribit/v2/DeribitAdapters.java @@ -351,7 +351,7 @@ public static UserTrades adaptUserTrades( } private static UserTrade adaptUserTrade(org.knowm.xchange.deribit.v2.dto.trade.Trade trade) { - return new UserTrade.Builder() + return UserTrade.builder() .type(adapt(trade.getDirection())) .originalAmount(trade.getAmount()) .instrument(adaptInstrument(trade.getInstrumentName())) diff --git a/xchange-dvchain/src/main/java/org/knowm/xchange/dvchain/DVChainAdapters.java b/xchange-dvchain/src/main/java/org/knowm/xchange/dvchain/DVChainAdapters.java index 6c9c380a757..8bf50089cdb 100644 --- a/xchange-dvchain/src/main/java/org/knowm/xchange/dvchain/DVChainAdapters.java +++ b/xchange-dvchain/src/main/java/org/knowm/xchange/dvchain/DVChainAdapters.java @@ -58,7 +58,7 @@ public static UserTrades adaptTradeHistory(List trades) { CurrencyPair currencyPair = new CurrencyPair(trade.getAsset(), "USD"); final BigDecimal fee = null; pastTrades.add( - new UserTrade.Builder() + UserTrade.builder() .type(orderType) .originalAmount(trade.getQuantity()) .currencyPair(currencyPair) diff --git a/xchange-exmo/src/main/java/org/knowm/xchange/exmo/service/ExmoAdapters.java b/xchange-exmo/src/main/java/org/knowm/xchange/exmo/service/ExmoAdapters.java index 4b085133ab5..374b2978dcd 100644 --- a/xchange-exmo/src/main/java/org/knowm/xchange/exmo/service/ExmoAdapters.java +++ b/xchange-exmo/src/main/java/org/knowm/xchange/exmo/service/ExmoAdapters.java @@ -24,7 +24,7 @@ public static UserTrade adaptTrade(Map tradeDatum, CurrencyPair String tradeId = tradeDatum.get("trade_id"); String orderId = tradeDatum.get("order_id"); - return new UserTrade.Builder() + return UserTrade.builder() .type(type) .originalAmount(amount) .currencyPair(currencyPair) diff --git a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/FtxAdapters.java b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/FtxAdapters.java index a58e766c10d..406f621ff22 100644 --- a/xchange-ftx/src/main/java/org/knowm/xchange/ftx/FtxAdapters.java +++ b/xchange-ftx/src/main/java/org/knowm/xchange/ftx/FtxAdapters.java @@ -241,7 +241,7 @@ public static UserTrades adaptUserTrades(List ftxUserTrades) { ftxFillDto -> { if (ftxFillDto.getSize().compareTo(BigDecimal.ZERO) != 0) { userTrades.add( - new UserTrade.Builder() + UserTrade.builder() .instrument( CurrencyPairDeserializer.getCurrencyPairFromString(ftxFillDto.getMarket())) .currencyPair( diff --git a/xchange-gateio/src/main/java/org/knowm/xchange/gateio/GateioAdapters.java b/xchange-gateio/src/main/java/org/knowm/xchange/gateio/GateioAdapters.java index 35376cfc7dc..09097effad1 100644 --- a/xchange-gateio/src/main/java/org/knowm/xchange/gateio/GateioAdapters.java +++ b/xchange-gateio/src/main/java/org/knowm/xchange/gateio/GateioAdapters.java @@ -215,7 +215,7 @@ public static UserTrade adaptUserTrade(GateioTrade gateioTrade) { Date timestamp = DateUtils.fromMillisUtc(gateioTrade.getTimeUnix() * 1000); CurrencyPair currencyPair = adaptCurrencyPair(gateioTrade.getPair()); - return new UserTrade.Builder() + return UserTrade.builder() .type(orderType) .originalAmount(gateioTrade.getAmount()) .currencyPair(currencyPair) diff --git a/xchange-gemini/src/main/java/org/knowm/xchange/gemini/v1/GeminiAdapters.java b/xchange-gemini/src/main/java/org/knowm/xchange/gemini/v1/GeminiAdapters.java index a58c124cd0a..33218c15ef9 100644 --- a/xchange-gemini/src/main/java/org/knowm/xchange/gemini/v1/GeminiAdapters.java +++ b/xchange-gemini/src/main/java/org/knowm/xchange/gemini/v1/GeminiAdapters.java @@ -417,7 +417,7 @@ public static UserTrades adaptTradeHistory(GeminiTradeResponse[] trades, String Date timestamp = convertBigDecimalTimestampToDate(trade.getTimestamp()); final BigDecimal fee = trade.getFeeAmount(); pastTrades.add( - new UserTrade.Builder() + UserTrade.builder() .type(orderType) .originalAmount(trade.getAmount()) .currencyPair(currencyPair) diff --git a/xchange-globitex/src/main/java/org/knowm/xchange/globitex/GlobitexAdapters.java b/xchange-globitex/src/main/java/org/knowm/xchange/globitex/GlobitexAdapters.java index f2ec8861c4a..fd60b45c120 100644 --- a/xchange-globitex/src/main/java/org/knowm/xchange/globitex/GlobitexAdapters.java +++ b/xchange-globitex/src/main/java/org/knowm/xchange/globitex/GlobitexAdapters.java @@ -205,7 +205,7 @@ public static UserTrades adaptToUserTrades(GlobitexUserTrades globitexUserTrades } private static UserTrade adaptToUserTrade(GlobitexUserTrade globitexUserTrade) { - return new UserTrade.Builder() + return UserTrade.builder() .type( (globitexUserTrade.getSide().equals("sell") ? Order.OrderType.ASK diff --git a/xchange-huobi/src/main/java/org/knowm/xchange/huobi/HuobiAdapters.java b/xchange-huobi/src/main/java/org/knowm/xchange/huobi/HuobiAdapters.java index 19b5a425253..5adf61133f3 100644 --- a/xchange-huobi/src/main/java/org/knowm/xchange/huobi/HuobiAdapters.java +++ b/xchange-huobi/src/main/java/org/knowm/xchange/huobi/HuobiAdapters.java @@ -304,7 +304,7 @@ private static UserTrade adaptTrade(LimitOrder order) { .multiply(order.getLimitPrice()) .multiply(fee) .setScale(8, RoundingMode.DOWN); - return new UserTrade.Builder() + return UserTrade.builder() .type(order.getType()) .originalAmount(order.getCumulativeAmount()) .currencyPair(order.getCurrencyPair()) @@ -365,7 +365,7 @@ public static List adaptOrders(List huobiOrders) { public static List adaptUserTradeList(HuobiOrder[] tradeHistory){ return Arrays.stream(tradeHistory).sequential() - .map(huobiOrder -> new UserTrade.Builder() + .map(huobiOrder -> UserTrade.builder() .id(Long.toString(huobiOrder.getId())) .instrument(adaptCurrencyPair(huobiOrder.getSymbol())) .orderUserReference(huobiOrder.getClOrdId()) diff --git a/xchange-idex/src/main/java/org/knowm/xchange/idex/IdexTradeService.java b/xchange-idex/src/main/java/org/knowm/xchange/idex/IdexTradeService.java index 537fea53f22..be556d13adf 100644 --- a/xchange-idex/src/main/java/org/knowm/xchange/idex/IdexTradeService.java +++ b/xchange-idex/src/main/java/org/knowm/xchange/idex/IdexTradeService.java @@ -161,7 +161,7 @@ public UserTrades getTradeHistory(TradeHistoryParams tradeHistoryParams) { returnTradeHistoryApi.tradeHistory((TradeHistoryReq) tradeHistoryParams).stream() .map( tradeHistoryItem -> - new UserTrade.Builder() + UserTrade.builder() .originalAmount( IdexExchange.Companion.safeParse(tradeHistoryItem.getAmount())) .price(IdexExchange.Companion.safeParse(tradeHistoryItem.getPrice())) diff --git a/xchange-independentreserve/src/main/java/org/knowm/xchange/independentreserve/IndependentReserveAdapters.java b/xchange-independentreserve/src/main/java/org/knowm/xchange/independentreserve/IndependentReserveAdapters.java index e3164bb8b4b..042f65334d5 100644 --- a/xchange-independentreserve/src/main/java/org/knowm/xchange/independentreserve/IndependentReserveAdapters.java +++ b/xchange-independentreserve/src/main/java/org/knowm/xchange/independentreserve/IndependentReserveAdapters.java @@ -197,7 +197,7 @@ public static UserTrades adaptTradeHistory( CurrencyPair currencyPair = new CurrencyPair(primary, secondary); UserTrade ut = - new UserTrade.Builder() + UserTrade.builder() .type(adapeOrderType(trade.getOrderType())) .originalAmount(trade.getVolumeTraded()) .currencyPair(currencyPair) diff --git a/xchange-itbit/src/main/java/org/knowm/xchange/itbit/ItBitAdapters.java b/xchange-itbit/src/main/java/org/knowm/xchange/itbit/ItBitAdapters.java index 82257c81ffc..92271fc5cae 100644 --- a/xchange-itbit/src/main/java/org/knowm/xchange/itbit/ItBitAdapters.java +++ b/xchange-itbit/src/main/java/org/knowm/xchange/itbit/ItBitAdapters.java @@ -258,7 +258,7 @@ public static UserTrades adaptTradeHistory(ItBitTradeHistory history) { Currency feeCcy = adaptCcy(ccy == null ? itBitTrade.getRebateCurrency() : ccy); UserTrade userTrade = - new UserTrade.Builder() + UserTrade.builder() .type(orderType) .originalAmount(totalQuantity) .currencyPair(currencyPair) diff --git a/xchange-krakenfutures/src/main/java/org/knowm/xchange/krakenfutures/KrakenFuturesAdapters.java b/xchange-krakenfutures/src/main/java/org/knowm/xchange/krakenfutures/KrakenFuturesAdapters.java index c8ca04c4517..2a5fbc64a06 100644 --- a/xchange-krakenfutures/src/main/java/org/knowm/xchange/krakenfutures/KrakenFuturesAdapters.java +++ b/xchange-krakenfutures/src/main/java/org/knowm/xchange/krakenfutures/KrakenFuturesAdapters.java @@ -139,7 +139,7 @@ public static OpenOrders adaptOpenOrders(KrakenFuturesOpenOrders orders) { } public static UserTrade adaptFill(KrakenFuturesFill fill) { - return new UserTrade.Builder() + return UserTrade.builder() .type(adaptOrderType(fill.getSide())) .originalAmount(fill.getSize()) .instrument(adaptInstrument(fill.getSymbol())) diff --git a/xchange-kucoin/src/main/java/org/knowm/xchange/kucoin/KucoinAdapters.java b/xchange-kucoin/src/main/java/org/knowm/xchange/kucoin/KucoinAdapters.java index 22bfd285fc6..ef6c9dcf9f1 100644 --- a/xchange-kucoin/src/main/java/org/knowm/xchange/kucoin/KucoinAdapters.java +++ b/xchange-kucoin/src/main/java/org/knowm/xchange/kucoin/KucoinAdapters.java @@ -325,7 +325,7 @@ public static Order adaptOrder(OrderResponse order) { } public static UserTrade adaptUserTrade(TradeResponse trade) { - return new UserTrade.Builder() + return UserTrade.builder() .currencyPair(adaptCurrencyPair(trade.getSymbol())) .feeAmount(trade.getFee()) .feeCurrency(Currency.getInstance(trade.getFeeCurrency())) @@ -340,7 +340,7 @@ public static UserTrade adaptUserTrade(TradeResponse trade) { public static UserTrade adaptHistOrder(HistOrdersResponse histOrder) { CurrencyPair currencyPair = adaptCurrencyPair(histOrder.getSymbol()); - return new UserTrade.Builder() + return UserTrade.builder() .currencyPair(currencyPair) .feeAmount(histOrder.getFee()) .feeCurrency(currencyPair.base) diff --git a/xchange-latoken/src/main/java/org/knowm/xchange/latoken/LatokenAdapters.java b/xchange-latoken/src/main/java/org/knowm/xchange/latoken/LatokenAdapters.java index d39c83e3fa2..18968fa35b2 100644 --- a/xchange-latoken/src/main/java/org/knowm/xchange/latoken/LatokenAdapters.java +++ b/xchange-latoken/src/main/java/org/knowm/xchange/latoken/LatokenAdapters.java @@ -204,7 +204,7 @@ public static UserTrades adaptUserTrades(Exchange exchange, LatokenUserTrades la } public static UserTrade adaptUserTrade(LatokenUserTrade latokenUserTrade, CurrencyPair pair) { - return new UserTrade.Builder() + return UserTrade.builder() .type(adaptOrderType(latokenUserTrade.getSide())) .originalAmount(latokenUserTrade.getAmount()) .currencyPair(pair) diff --git a/xchange-lgo/src/main/java/org/knowm/xchange/lgo/LgoAdapters.java b/xchange-lgo/src/main/java/org/knowm/xchange/lgo/LgoAdapters.java index 8c39a1c7583..f36b8233dd2 100644 --- a/xchange-lgo/src/main/java/org/knowm/xchange/lgo/LgoAdapters.java +++ b/xchange-lgo/src/main/java/org/knowm/xchange/lgo/LgoAdapters.java @@ -160,7 +160,7 @@ private static UserTrade adaptUserTrade(LgoUserTrade lgoUserTrade) { OrderType type = adaptUserTradeType(lgoUserTrade); CurrencyPair currencyPair = adaptProductId(lgoUserTrade.getProductId()); Date creationDate = lgoUserTrade.getCreationDate(); - return new UserTrade.Builder() + return UserTrade.builder() .type(type) .originalAmount(lgoUserTrade.getQuantity()) .currencyPair(currencyPair) diff --git a/xchange-lgo/src/test/java/org/knowm/xchange/lgo/LgoAdaptersTest.java b/xchange-lgo/src/test/java/org/knowm/xchange/lgo/LgoAdaptersTest.java index 281bef43d08..b1759322b2d 100644 --- a/xchange-lgo/src/test/java/org/knowm/xchange/lgo/LgoAdaptersTest.java +++ b/xchange-lgo/src/test/java/org/knowm/xchange/lgo/LgoAdaptersTest.java @@ -218,7 +218,7 @@ public void adaptsUserTrades() throws IOException, ParseException { assertThat(userTrades.getUserTrades()).hasSize(2); assertThat(userTrades.getUserTrades().get(0)) .isEqualToComparingFieldByField( - new UserTrade.Builder() + UserTrade.builder() .type(OrderType.ASK) .originalAmount(new BigDecimal("0.00500000")) .currencyPair(CurrencyPair.BTC_USD) @@ -231,7 +231,7 @@ public void adaptsUserTrades() throws IOException, ParseException { .build()); assertThat(userTrades.getUserTrades().get(1)) .isEqualToComparingFieldByField( - new UserTrade.Builder() + UserTrade.builder() .type(OrderType.BID) .originalAmount(new BigDecimal("0.00829566")) .currencyPair(CurrencyPair.BTC_USD) diff --git a/xchange-livecoin/src/main/java/org/knowm/xchange/livecoin/LivecoinAdapters.java b/xchange-livecoin/src/main/java/org/knowm/xchange/livecoin/LivecoinAdapters.java index f5de978560f..170c26aa652 100644 --- a/xchange-livecoin/src/main/java/org/knowm/xchange/livecoin/LivecoinAdapters.java +++ b/xchange-livecoin/src/main/java/org/knowm/xchange/livecoin/LivecoinAdapters.java @@ -231,7 +231,7 @@ public static UserTrade adaptUserTrade(Map map) { String id = map.get("id").toString(); - return new UserTrade.Builder() + return UserTrade.builder() .type(type) .originalAmount(amountA) .currencyPair(new CurrencyPair(ccyA, ccyB)) diff --git a/xchange-luno/src/main/java/org/knowm/xchange/luno/service/LunoTradeService.java b/xchange-luno/src/main/java/org/knowm/xchange/luno/service/LunoTradeService.java index 0540edb1267..8b8eb6ec00d 100644 --- a/xchange-luno/src/main/java/org/knowm/xchange/luno/service/LunoTradeService.java +++ b/xchange-luno/src/main/java/org/knowm/xchange/luno/service/LunoTradeService.java @@ -173,7 +173,7 @@ public UserTrades getTradeHistory(TradeHistoryParams params) feeCurrency = pair.counter; } trades.add( - new UserTrade.Builder() + UserTrade.builder() .type(t.buy ? OrderType.BID : OrderType.ASK) .originalAmount(t.volume) .currencyPair(pair) diff --git a/xchange-lykke/src/main/java/org/knowm/xchange/lykke/LykkeAdapter.java b/xchange-lykke/src/main/java/org/knowm/xchange/lykke/LykkeAdapter.java index f7f0abc3d91..8ae922abced 100644 --- a/xchange-lykke/src/main/java/org/knowm/xchange/lykke/LykkeAdapter.java +++ b/xchange-lykke/src/main/java/org/knowm/xchange/lykke/LykkeAdapter.java @@ -120,7 +120,7 @@ public static List adaptUserTrades( private static UserTrade adaptUserTrade( List currencyPairList, LykkeOrder tradeHistory) throws IOException { - return new UserTrade.Builder() + return UserTrade.builder() .type(getOrderTypeFromVolumeSign(tradeHistory.getVolume())) .originalAmount( BigDecimal.valueOf(Math.abs(tradeHistory.getVolume())) diff --git a/xchange-mercadobitcoin/src/main/java/org/knowm/xchange/mercadobitcoin/MercadoBitcoinAdapters.java b/xchange-mercadobitcoin/src/main/java/org/knowm/xchange/mercadobitcoin/MercadoBitcoinAdapters.java index ccc87db431d..f9c13d0098e 100644 --- a/xchange-mercadobitcoin/src/main/java/org/knowm/xchange/mercadobitcoin/MercadoBitcoinAdapters.java +++ b/xchange-mercadobitcoin/src/main/java/org/knowm/xchange/mercadobitcoin/MercadoBitcoinAdapters.java @@ -216,7 +216,7 @@ public static UserTrades toUserTrades( String txId = f.getKey(); OperationEntry op = f.getValue(); result.add( - new UserTrade.Builder() + UserTrade.builder() .currencyPair(pair) .id(txId) .orderId(orderId) diff --git a/xchange-okcoin/src/main/java/org/knowm/xchange/okcoin/OkCoinAdapters.java b/xchange-okcoin/src/main/java/org/knowm/xchange/okcoin/OkCoinAdapters.java index 66966c9ce85..a8de7e5d3aa 100644 --- a/xchange-okcoin/src/main/java/org/knowm/xchange/okcoin/OkCoinAdapters.java +++ b/xchange-okcoin/src/main/java/org/knowm/xchange/okcoin/OkCoinAdapters.java @@ -322,7 +322,7 @@ private static UserTrade adaptTrade(OkCoinOrder order) { // instead. String tradeId, orderId; tradeId = orderId = String.valueOf(order.getOrderId()); - return new UserTrade.Builder() + return UserTrade.builder() .type(adaptOrderType(order.getType())) .originalAmount(order.getDealAmount()) .currencyPair(adaptSymbol(order.getSymbol())) @@ -335,7 +335,7 @@ private static UserTrade adaptTrade(OkCoinOrder order) { private static UserTrade adaptTradeFutures(OkCoinFuturesOrder order) { - return new UserTrade.Builder() + return UserTrade.builder() .type(adaptOrderType(order.getType())) .originalAmount(order.getDealAmount()) .currencyPair(adaptSymbol(order.getSymbol())) @@ -368,7 +368,7 @@ public static UserTrades adaptTradeHistory( BigDecimal feeAmount = BigDecimal.ZERO; UserTrade trade = - new UserTrade.Builder() + UserTrade.builder() .type(orderType) .originalAmount(originalAmount) .currencyPair(currencyPair) diff --git a/xchange-okcoin/src/main/java/org/knowm/xchange/okcoin/v3/service/OkexTradeService.java b/xchange-okcoin/src/main/java/org/knowm/xchange/okcoin/v3/service/OkexTradeService.java index 6d88a48bcab..04a9051e5d9 100644 --- a/xchange-okcoin/src/main/java/org/knowm/xchange/okcoin/v3/service/OkexTradeService.java +++ b/xchange-okcoin/src/main/java/org/knowm/xchange/okcoin/v3/service/OkexTradeService.java @@ -215,7 +215,7 @@ public UserTrades getTradeHistory(TradeHistoryParams params) throws IOException } UserTrade ut = - new UserTrade.Builder() + UserTrade.builder() .currencyPair(p) .id(t.getLedgerId()) .orderId(o.getOrderId()) @@ -295,7 +295,7 @@ public UserTrades getMarginTradeHistory(TradeHistoryParams params) throws IOExce } UserTrade ut = - new UserTrade.Builder() + UserTrade.builder() .currencyPair(p) .id(t.getLedgerId()) .orderId(o.getOrderId()) diff --git a/xchange-okex/src/main/java/org/knowm/xchange/okex/OkexAdapters.java b/xchange-okex/src/main/java/org/knowm/xchange/okex/OkexAdapters.java index 39a0b53abd1..c7ec07deeaf 100644 --- a/xchange-okex/src/main/java/org/knowm/xchange/okex/OkexAdapters.java +++ b/xchange-okex/src/main/java/org/knowm/xchange/okex/OkexAdapters.java @@ -48,7 +48,7 @@ public static UserTrades adaptUserTrades(List okexTradeHistory okexOrderDetails -> { Instrument instrument = adaptOkexInstrumentId(okexOrderDetails.getInstrumentId()); userTradeList.add( - new UserTrade.Builder() + UserTrade.builder() .originalAmount(convertContractSizeToVolume(okexOrderDetails.getAmount(), instrument, exchangeMetaData.getInstruments().get(instrument).getContractValue())) .instrument(instrument) .price(new BigDecimal(okexOrderDetails.getAverageFilledPrice())) diff --git a/xchange-paymium/src/main/java/org/knowm/xchange/paymium/service/PaymiumTradeService.java b/xchange-paymium/src/main/java/org/knowm/xchange/paymium/service/PaymiumTradeService.java index c8d387136c3..03f5a466dcc 100644 --- a/xchange-paymium/src/main/java/org/knowm/xchange/paymium/service/PaymiumTradeService.java +++ b/xchange-paymium/src/main/java/org/knowm/xchange/paymium/service/PaymiumTradeService.java @@ -71,7 +71,7 @@ public UserTrades getTradeHistory(TradeHistoryParams params) throws IOException } UserTrade userTrade = - new UserTrade.Builder() + UserTrade.builder() .type(orderType) .originalAmount(order.getTradedCurrency()) .currencyPair(CurrencyPair.BTC_EUR) diff --git a/xchange-poloniex/src/main/java/org/knowm/xchange/poloniex/PoloniexAdapters.java b/xchange-poloniex/src/main/java/org/knowm/xchange/poloniex/PoloniexAdapters.java index 1825b1d321b..6106d90c31b 100644 --- a/xchange-poloniex/src/main/java/org/knowm/xchange/poloniex/PoloniexAdapters.java +++ b/xchange-poloniex/src/main/java/org/knowm/xchange/poloniex/PoloniexAdapters.java @@ -224,7 +224,7 @@ public static UserTrade adaptPoloniexUserTrade( feeCurrencyCode = currencyPair.base.getCurrencyCode(); } - return new UserTrade.Builder() + return UserTrade.builder() .type(orderType) .originalAmount(amount) .currencyPair(currencyPair) diff --git a/xchange-quoine/src/main/java/org/knowm/xchange/quoine/QuoineAdapters.java b/xchange-quoine/src/main/java/org/knowm/xchange/quoine/QuoineAdapters.java index 38cc5658a46..dbf03ad14f3 100644 --- a/xchange-quoine/src/main/java/org/knowm/xchange/quoine/QuoineAdapters.java +++ b/xchange-quoine/src/main/java/org/knowm/xchange/quoine/QuoineAdapters.java @@ -193,7 +193,7 @@ public static List adapt(List executions, CurrencyPa List res = new ArrayList<>(); for (QuoineExecution execution : executions) { res.add( - new UserTrade.Builder() + UserTrade.builder() .type(execution.mySide.equals("sell") ? OrderType.ASK : OrderType.BID) .originalAmount(execution.quantity) .currencyPair(currencyPair) diff --git a/xchange-simulated/src/main/java/org/knowm/xchange/simulated/MatchingEngine.java b/xchange-simulated/src/main/java/org/knowm/xchange/simulated/MatchingEngine.java index 365bd96e451..02bcde12dda 100644 --- a/xchange-simulated/src/main/java/org/knowm/xchange/simulated/MatchingEngine.java +++ b/xchange-simulated/src/main/java/org/knowm/xchange/simulated/MatchingEngine.java @@ -270,7 +270,7 @@ private void matchOff(BookOrder takerOrder, BookOrder makerOrder, BigDecimal tra Date timestamp = new Date(); UserTrade takerTrade = - new UserTrade.Builder() + UserTrade.builder() .currencyPair(currencyPair) .id(randomUUID().toString()) .originalAmount(tradeAmount) @@ -291,7 +291,7 @@ private void matchOff(BookOrder takerOrder, BookOrder makerOrder, BigDecimal tra OrderType makerType = takerOrder.getType() == OrderType.ASK ? OrderType.BID : OrderType.ASK; UserTrade makerTrade = - new UserTrade.Builder() + UserTrade.builder() .currencyPair(currencyPair) .id(randomUUID().toString()) .originalAmount(tradeAmount) diff --git a/xchange-stream-binance/src/main/java/info/bitrich/xchangestream/binance/dto/ExecutionReportBinanceUserTransaction.java b/xchange-stream-binance/src/main/java/info/bitrich/xchangestream/binance/dto/ExecutionReportBinanceUserTransaction.java index 0d56fff7c57..cd789d27700 100644 --- a/xchange-stream-binance/src/main/java/info/bitrich/xchangestream/binance/dto/ExecutionReportBinanceUserTransaction.java +++ b/xchange-stream-binance/src/main/java/info/bitrich/xchangestream/binance/dto/ExecutionReportBinanceUserTransaction.java @@ -102,7 +102,7 @@ public ExecutionReportBinanceUserTransaction( public UserTrade toUserTrade(boolean isFuture) { if (executionType != ExecutionType.TRADE) throw new IllegalStateException("Not a trade"); - return new UserTrade.Builder() + return UserTrade.builder() .type(BinanceAdapters.convert(side)) .originalAmount(lastExecutedQuantity) .instrument(BinanceAdapters.adaptSymbol(symbol, isFuture)) diff --git a/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingAdapters.java b/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingAdapters.java index 4152f6968c7..3089c1806b9 100644 --- a/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingAdapters.java +++ b/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingAdapters.java @@ -261,7 +261,7 @@ static Order adaptOrder(BitfinexWebSocketAuthOrder authOrder) { } static UserTrade adaptUserTrade(BitfinexWebSocketAuthTrade authTrade) { - return new UserTrade.Builder() + return UserTrade.builder() .currencyPair(BitfinexAdapters.adaptCurrencyPair(adaptV2SymbolToV1(authTrade.getPair()))) .feeAmount(authTrade.getFee().abs()) .feeCurrency(Currency.getInstance(authTrade.getFeeCurrency())) diff --git a/xchange-stream-coinjar/src/main/java/info/bitrich/xchangestream/coinjar/CoinjarStreamingAdapters.java b/xchange-stream-coinjar/src/main/java/info/bitrich/xchangestream/coinjar/CoinjarStreamingAdapters.java index 4b6e5754b8a..d9cc4d10ebc 100644 --- a/xchange-stream-coinjar/src/main/java/info/bitrich/xchangestream/coinjar/CoinjarStreamingAdapters.java +++ b/xchange-stream-coinjar/src/main/java/info/bitrich/xchangestream/coinjar/CoinjarStreamingAdapters.java @@ -52,7 +52,7 @@ public static List toLimitOrders( } public static UserTrade adaptUserTrade(CoinjarWebSocketUserTradeEvent event) { - return new UserTrade.Builder() + return UserTrade.builder() .timestamp(Date.from(ZonedDateTime.parse(event.payload.fill.timestamp).toInstant())) .id(Long.toString(event.payload.fill.tid)) .originalAmount(new BigDecimal(event.payload.fill.size)) diff --git a/xchange-stream-coinjar/src/test/java/info/bitrich/xchangestream/coinjar/CoinjarStreamingAdaptersTest.java b/xchange-stream-coinjar/src/test/java/info/bitrich/xchangestream/coinjar/CoinjarStreamingAdaptersTest.java index eda555f26a4..d0e5ae90040 100644 --- a/xchange-stream-coinjar/src/test/java/info/bitrich/xchangestream/coinjar/CoinjarStreamingAdaptersTest.java +++ b/xchange-stream-coinjar/src/test/java/info/bitrich/xchangestream/coinjar/CoinjarStreamingAdaptersTest.java @@ -48,7 +48,7 @@ public void testAdaptUserTrade() { UserTrade userTrade = CoinjarStreamingAdapters.adaptUserTrade(event); UserTrade expected = - new UserTrade.Builder() + UserTrade.builder() .id("9130900") .orderId("280117631") .currencyPair(CurrencyPair.BTC_AUD) diff --git a/xchange-stream-coinmate/src/main/java/info/bitrich/xchangestream/coinmate/v2/CoinmateStreamingAdapter.java b/xchange-stream-coinmate/src/main/java/info/bitrich/xchangestream/coinmate/v2/CoinmateStreamingAdapter.java index 5f515ad3c9d..cb5504ddb3e 100644 --- a/xchange-stream-coinmate/src/main/java/info/bitrich/xchangestream/coinmate/v2/CoinmateStreamingAdapter.java +++ b/xchange-stream-coinmate/src/main/java/info/bitrich/xchangestream/coinmate/v2/CoinmateStreamingAdapter.java @@ -31,7 +31,7 @@ public static UserTrades adaptWebSocketUserTrades( coinmateWebSocketUserTrades.forEach( (coinmateWebSocketUserTrade) -> { userTrades.add( - new UserTrade.Builder() + UserTrade.builder() .type( (coinmateWebSocketUserTrade.getUserOrderType().equals("SELL")) ? Order.OrderType.ASK diff --git a/xchange-stream-ftx/src/main/java/info/bitrich/xchangestream/ftx/FtxStreamingAdapters.java b/xchange-stream-ftx/src/main/java/info/bitrich/xchangestream/ftx/FtxStreamingAdapters.java index c8a833e8957..5f2d8b7267b 100644 --- a/xchange-stream-ftx/src/main/java/info/bitrich/xchangestream/ftx/FtxStreamingAdapters.java +++ b/xchange-stream-ftx/src/main/java/info/bitrich/xchangestream/ftx/FtxStreamingAdapters.java @@ -223,7 +223,7 @@ public static UserTrade adaptUserTrade(JsonNode jsonNode) { JsonNode data = jsonNode.get("data"); Builder userTradeBuilder = - new Builder() + UserTrade.builder() .currencyPair(new CurrencyPair(data.get("market").asText())) .type("buy".equals(data.get("side").asText()) ? OrderType.BID : OrderType.ASK) .instrument(new CurrencyPair(data.get("market").asText())) diff --git a/xchange-stream-kraken/src/main/java/info/bitrich/xchangestream/kraken/KrakenStreamingTradeService.java b/xchange-stream-kraken/src/main/java/info/bitrich/xchangestream/kraken/KrakenStreamingTradeService.java index 6779ce72b67..2f51909d01e 100644 --- a/xchange-stream-kraken/src/main/java/info/bitrich/xchangestream/kraken/KrakenStreamingTradeService.java +++ b/xchange-stream-kraken/src/main/java/info/bitrich/xchangestream/kraken/KrakenStreamingTradeService.java @@ -206,7 +206,7 @@ private List adaptKrakenUserTrade(KrakenDtoUserTradeHolder[] ownTrade CurrencyPair currencyPair = new CurrencyPair(dto.pair); result.add( - new UserTrade.Builder() + UserTrade.builder() .id(tradeId) // The tradeId should be the key of the map, postxid can be null and is // not unique as required for a tradeId .orderId(dto.ordertxid) diff --git a/xchange-stream-krakenfutures/src/main/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingAdapters.java b/xchange-stream-krakenfutures/src/main/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingAdapters.java index c54cc5b6d11..df0839a771d 100644 --- a/xchange-stream-krakenfutures/src/main/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingAdapters.java +++ b/xchange-stream-krakenfutures/src/main/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingAdapters.java @@ -73,7 +73,7 @@ public static Trade adaptTrade(KrakenFuturesStreamingTradeResponse trade) { public static List adaptUserTrades(KrakenFuturesStreamingFillsDeltaResponse fills) { List userTrades = new ArrayList<>(); - fills.getFills().forEach(krakenFuturesStreamingFill -> userTrades.add(new UserTrade.Builder() + fills.getFills().forEach(krakenFuturesStreamingFill -> userTrades.add(UserTrade.builder() .price(krakenFuturesStreamingFill.getPrice()) .originalAmount(krakenFuturesStreamingFill.getQty()) .id(krakenFuturesStreamingFill.getFill_id()) diff --git a/xchange-stream-lgo/src/main/java/info/bitrich/xchangestream/lgo/LgoAdapter.java b/xchange-stream-lgo/src/main/java/info/bitrich/xchangestream/lgo/LgoAdapter.java index e2f91b9a1f8..eec1244bbd1 100644 --- a/xchange-stream-lgo/src/main/java/info/bitrich/xchangestream/lgo/LgoAdapter.java +++ b/xchange-stream-lgo/src/main/java/info/bitrich/xchangestream/lgo/LgoAdapter.java @@ -135,7 +135,7 @@ static List adaptOrderEvent( } static UserTrade adaptUserTrade(CurrencyPair currencyPair, LgoMatchOrderEvent event) { - return new UserTrade.Builder() + return UserTrade.builder() .type(event.getOrderType()) .originalAmount(event.getFilledQuantity()) .currencyPair(currencyPair) diff --git a/xchange-stream-lgo/src/test/java/info/bitrich/xchangestream/lgo/LgoStreamingTradeServiceTest.java b/xchange-stream-lgo/src/test/java/info/bitrich/xchangestream/lgo/LgoStreamingTradeServiceTest.java index 3b951b341e0..b05a73e3282 100644 --- a/xchange-stream-lgo/src/test/java/info/bitrich/xchangestream/lgo/LgoStreamingTradeServiceTest.java +++ b/xchange-stream-lgo/src/test/java/info/bitrich/xchangestream/lgo/LgoStreamingTradeServiceTest.java @@ -254,7 +254,7 @@ public void it_handles_trades() throws IOException, ParseException { assertThat(trades.get(0)) .usingRecursiveComparison() .isEqualTo( - new UserTrade.Builder() + UserTrade.builder() .type(Order.OrderType.ASK) .originalAmount(new BigDecimal("0.50000000")) .currencyPair(CurrencyPair.BTC_USD) diff --git a/xchange-therock/src/main/java/org/knowm/xchange/therock/TheRockAdapters.java b/xchange-therock/src/main/java/org/knowm/xchange/therock/TheRockAdapters.java index be6e6246c0e..6891ab863ee 100644 --- a/xchange-therock/src/main/java/org/knowm/xchange/therock/TheRockAdapters.java +++ b/xchange-therock/src/main/java/org/knowm/xchange/therock/TheRockAdapters.java @@ -108,7 +108,7 @@ public static UserTrade adaptUserTrade(TheRockUserTrade trade, CurrencyPair curr final String tradeId = String.valueOf(trade.getId()); // return new UserTrade(trade.getSide() == Side.sell ? OrderType.ASK : BID, trade.getAmount(), // currencyPair, trade.getPrice(), trade.getDate(), tradeId); - return new UserTrade.Builder() + return UserTrade.builder() .id(tradeId) .originalAmount(trade.getAmount()) .currencyPair(currencyPair) diff --git a/xchange-yobit/src/main/java/org/knowm/xchange/yobit/YoBitAdapters.java b/xchange-yobit/src/main/java/org/knowm/xchange/yobit/YoBitAdapters.java index 86292ed4b80..313c75702df 100644 --- a/xchange-yobit/src/main/java/org/knowm/xchange/yobit/YoBitAdapters.java +++ b/xchange-yobit/src/main/java/org/knowm/xchange/yobit/YoBitAdapters.java @@ -242,7 +242,7 @@ public static UserTrade adaptUserTrade(Object key, Map tradeData) { Date time = DateUtils.fromUnixTime(Long.parseLong(timestamp)); - return new UserTrade.Builder() + return UserTrade.builder() .type(adaptType(type)) .originalAmount(new BigDecimal(amount)) .currencyPair(adaptCurrencyPair(pair))