Skip to content

Commit

Permalink
updated Eclipse code formatter, formatted with Eclipse
Browse files Browse the repository at this point in the history
  • Loading branch information
timmolter committed Apr 15, 2017
1 parent 24e80e0 commit 8dd1121
Show file tree
Hide file tree
Showing 304 changed files with 2,823 additions and 1,410 deletions.
1,553 changes: 1,553 additions & 0 deletions etc/XChange_Eclipse_2017_04.xml

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions xchange-anx/src/main/java/org/knowm/xchange/anx/v2/ANXV2.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ ANXTickersWrapper getTickers(@PathParam("ident") String tradeableIdentifier, @Pa

@GET
@Path("{ident}{currency}/money/depth/fetch")
ANXDepthWrapper getPartialDepth(@PathParam("ident") String tradeableIdentifier, @PathParam("currency") String currency)
throws ANXException, IOException;
ANXDepthWrapper getPartialDepth(@PathParam("ident") String tradeableIdentifier,
@PathParam("currency") String currency) throws ANXException, IOException;

@GET
@Path("{ident}{currency}/money/depth/full")
ANXDepthWrapper getFullDepth(@PathParam("ident") String tradeableIdentifier, @PathParam("currency") String currency)
throws ANXException, IOException;
ANXDepthWrapper getFullDepth(@PathParam("ident") String tradeableIdentifier,
@PathParam("currency") String currency) throws ANXException, IOException;

@GET
@Path("{ident}{currency}/money/depth/full")
Expand All @@ -67,8 +67,8 @@ ANXDepthsWrapper getFullDepths(@PathParam("ident") String tradeableIdentifier, @

@GET
@Path("{ident}{currency}/money/trade/fetch")
ANXTradesWrapper getTrades(@PathParam("ident") String tradeableIdentifier, @PathParam("currency") String currency, @QueryParam("since") long since)
throws ANXException, IOException;
ANXTradesWrapper getTrades(@PathParam("ident") String tradeableIdentifier, @PathParam("currency") String currency,
@QueryParam("since") long since) throws ANXException, IOException;

// Account Info API

Expand Down Expand Up @@ -124,8 +124,8 @@ ANXOpenOrderWrapper getOpenOrders(@HeaderParam("Rest-Key") String apiKey, @Heade
@Path("money/trade/list")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
ANXTradeResultWrapper getExecutedTrades(@HeaderParam("Rest-Key") String apiKey, @HeaderParam("Rest-Sign") ParamsDigest postBodySignatureCreator,
@FormParam("nonce") SynchronizedValueFactory<Long> nonce, @FormParam("from") Long from, @FormParam("to") Long to)
throws ANXException, IOException;
@FormParam("nonce") SynchronizedValueFactory<Long> nonce, @FormParam("from") Long from,
@FormParam("to") Long to) throws ANXException, IOException;

/**
* Status of the order
Expand All @@ -144,8 +144,8 @@ ANXTradeResultWrapper getExecutedTrades(@HeaderParam("Rest-Key") String apiKey,
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
ANXOrderResultWrapper getOrderResult(@HeaderParam("Rest-Key") String apiKey, @HeaderParam("Rest-Sign") ParamsDigest postBodySignatureCreator,
@FormParam("nonce") SynchronizedValueFactory<Long> nonce, @PathParam("baseCurrency") String baseCurrency,
@PathParam("counterCurrency") String counterCurrency, @FormParam("order") String order, @FormParam("type") String type)
throws ANXException, IOException;
@PathParam("counterCurrency") String counterCurrency, @FormParam("order") String order,
@FormParam("type") String type) throws ANXException, IOException;

/**
* @param postBodySignatureCreator
Expand Down Expand Up @@ -191,6 +191,6 @@ ANXGenericResponse cancelOrder(@HeaderParam("Rest-Key") String apiKey, @HeaderPa
@Path("money/wallet/history")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
ANXWalletHistoryWrapper getWalletHistory(@HeaderParam("Rest-Key") String apiKey, @HeaderParam("Rest-Sign") ParamsDigest postBodySignatureCreator,
@FormParam("nonce") SynchronizedValueFactory<Long> nonce, @FormParam("currency") String currency, @FormParam("page") Integer page)
throws ANXException, IOException;
@FormParam("nonce") SynchronizedValueFactory<Long> nonce, @FormParam("currency") String currency,
@FormParam("page") Integer page) throws ANXException, IOException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ public TradeHistoryParams createFundingHistoryParams() {
}

@Override
public List<FundingRecord> getFundingHistory(TradeHistoryParams params) throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {
public List<FundingRecord> getFundingHistory(
TradeHistoryParams params) throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {
throw new NotYetImplementedForExchangeException();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public OpenOrders getOpenOrders() throws IOException {
}

@Override
public OpenOrders getOpenOrders(OpenOrdersParams params) throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {
public OpenOrders getOpenOrders(
OpenOrdersParams params) throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {
return new OpenOrders(ANXAdapters.adaptOrders(getANXOpenOrders()));
}

Expand Down Expand Up @@ -127,8 +128,8 @@ public OpenOrdersParams createOpenOrdersParams() {
}

@Override
public Collection<Order> getOrder(String... orderIds)
throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {
public Collection<Order> getOrder(
String... orderIds) throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {
throw new NotYetImplementedForExchangeException();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ private static LimitOrder createOrder(BitbayOrder bitbayOrder) {
throw new IllegalArgumentException(e);
}

return new LimitOrder(type, bitbayOrder.getAmount(), currencyPair, String.valueOf(bitbayOrder.getId()), date, bitbayOrder.getStartPrice()
.divide(bitbayOrder.getStartAmount()));
return new LimitOrder(type, bitbayOrder.getAmount(), currencyPair, String.valueOf(bitbayOrder.getId()), date,
bitbayOrder.getStartPrice().divide(bitbayOrder.getStartAmount()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,15 @@ BitbayAccountInfoResponse info(@HeaderParam("API-Key") String apiKey, @HeaderPar
* <p>
* Input:
* <p>
* type : offer type bid/buy or ask/sell
* currency : shortcut of main currency for offer (e.g. “BTC”)
* amount : quantity of main currency
* payment_currency : shortcut of currency used to pay for offer (e.g. “PLN”)
* rate : rate for offer
* type : offer type bid/buy or ask/sell currency : shortcut of main currency for offer (e.g. “BTC”) amount : quantity of main currency
* payment_currency : shortcut of currency used to pay for offer (e.g. “PLN”) rate : rate for offer
*/
@POST
@FormParam("method")
BitbayTradeResponse trade(@HeaderParam("API-Key") String apiKey, @HeaderParam("API-Hash") ParamsDigest sign,
@FormParam("moment") SynchronizedValueFactory<Long> timestamp, @FormParam("type") String type,
@FormParam("currency") String currency, @FormParam("amount") BigDecimal amount,
@FormParam("payment_currency") String paymentCurrency, @FormParam("rate") BigDecimal rate) throws IOException;
@FormParam("moment") SynchronizedValueFactory<Long> timestamp, @FormParam("type") String type, @FormParam("currency") String currency,
@FormParam("amount") BigDecimal amount, @FormParam("payment_currency") String paymentCurrency,
@FormParam("rate") BigDecimal rate) throws IOException;

/**
* cancel - removes offer from the stock market
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public class BitbayAccountInfoResponse extends BitbayBaseResponse {

private final Map<String, BitbayBalance> bitbayBalances;

public BitbayAccountInfoResponse(@JsonProperty("balances") Map<String, BitbayBalance> bitbayBalances,
@JsonProperty("success") boolean success, @JsonProperty("code") int code, @JsonProperty("message") String errorMsg) {
public BitbayAccountInfoResponse(@JsonProperty("balances") Map<String, BitbayBalance> bitbayBalances, @JsonProperty("success") boolean success,
@JsonProperty("code") int code, @JsonProperty("message") String errorMsg) {
super(success, code, errorMsg);

this.bitbayBalances = bitbayBalances;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ public class BitbayBalance {
private final BigDecimal locked;

/**
* available : amount of available money/cryptocurrency
* locked : amount of locked money/cryptocurrency
* available : amount of available money/cryptocurrency locked : amount of locked money/cryptocurrency
*/
public BitbayBalance(@JsonProperty("available") BigDecimal available, @JsonProperty("locked") BigDecimal locked) {
this.available = available;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,14 @@ public class BitbayOrder {
private final BigDecimal startPrice;

/**
* order_id : id of offer
* order_currency : main currency (e.g. “LTC”)
* order_date : time, when offer was changed recently
* payment_currency : shortcut of currency used to pay for offer
* type : bid/ask
* status : “active” if order is active, “inactive” if order is unactive
* units : current amount of main currency in order
* start_units : amount of main currency when order was added
* current_price : price for whole amount of main currency
* order_id : id of offer order_currency : main currency (e.g. “LTC”) order_date : time, when offer was changed recently payment_currency : shortcut
* of currency used to pay for offer type : bid/ask status : “active” if order is active, “inactive” if order is unactive units : current amount of
* main currency in order start_units : amount of main currency when order was added current_price : price for whole amount of main currency
* start_price : starting price for whole amount when offer was added
*/
public BitbayOrder(@JsonProperty("order_id") long id, @JsonProperty("order_currency") String currency, @JsonProperty("order_date") String date,
@JsonProperty("payment_currency") String paymentCurrency, @JsonProperty("type") String type,
@JsonProperty("status") String status, @JsonProperty("units") BigDecimal amount, @JsonProperty("start_units") BigDecimal startAmount,
@JsonProperty("payment_currency") String paymentCurrency, @JsonProperty("type") String type, @JsonProperty("status") String status,
@JsonProperty("units") BigDecimal amount, @JsonProperty("start_units") BigDecimal startAmount,
@JsonProperty("current_price") BigDecimal currentPrice, @JsonProperty("start_price") BigDecimal startPrice) {

this.id = id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
public class BitbayTradeResponse extends BitbayBaseResponse {
private final long orderId;

public BitbayTradeResponse(@JsonProperty("order_id") long orderId,
@JsonProperty("success") boolean success, @JsonProperty("code") int code, @JsonProperty("message") String errorMsg) {
public BitbayTradeResponse(@JsonProperty("order_id") long orderId, @JsonProperty("success") boolean success, @JsonProperty("code") int code,
@JsonProperty("message") String errorMsg) {

super(success, code, errorMsg);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ public AccountInfo getAccountInfo() throws IOException {
}

@Override
public String withdrawFunds(Currency currency, BigDecimal amount, String address) throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {
public String withdrawFunds(Currency currency, BigDecimal amount,
String address) throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {
throw new NotYetImplementedForExchangeException();
}

@Override
public String requestDepositAddress(Currency currency, String... args) throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {
public String requestDepositAddress(Currency currency,
String... args) throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {
throw new NotYetImplementedForExchangeException();
}

Expand All @@ -45,7 +47,8 @@ public TradeHistoryParams createFundingHistoryParams() {
}

@Override
public List<FundingRecord> getFundingHistory(TradeHistoryParams params) throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {
public List<FundingRecord> getFundingHistory(
TradeHistoryParams params) throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {
throw new NotYetImplementedForExchangeException();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,30 @@ public OpenOrders getOpenOrders() throws ExchangeException, NotAvailableFromExch
}

@Override
public OpenOrders getOpenOrders(OpenOrdersParams params) throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {
public OpenOrders getOpenOrders(
OpenOrdersParams params) throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {
List<BitbayOrder> response = getBitbayOpenOrders();
return BitbayAdapters.adaptOpenOrders(response);
}

@Override
public String placeMarketOrder(MarketOrder marketOrder)
throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {
public String placeMarketOrder(
MarketOrder marketOrder) throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {

throw new NotAvailableFromExchangeException();
}

@Override
public String placeLimitOrder(LimitOrder limitOrder)
throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {
public String placeLimitOrder(
LimitOrder limitOrder) throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {

BitbayTradeResponse response = placeBitbayOrder(limitOrder);
return String.valueOf(response.getOrderId());
}

@Override
public boolean cancelOrder(String orderId) throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {
public boolean cancelOrder(
String orderId) throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {
cancelBitbayOrder(Long.parseLong(orderId));
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ public static ExchangeMetaData adaptMetaData(BitcoinAverageTickers tickers, Exch
for (String currency : tickers.getTickers().keySet()) {
currencyPairs.put(new CurrencyPair(BTC, Currency.getInstance(currency)), null);
}
return new ExchangeMetaData(currencyPairs, Collections.<Currency, CurrencyMetaData>emptyMap(), null, null, null);
return new ExchangeMetaData(currencyPairs, Collections.<Currency, CurrencyMetaData> emptyMap(), null, null, null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,21 @@ public BitcoinCoreAccountService(Exchange exchange) {
}

@Override
public AccountInfo getAccountInfo()
throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {
public AccountInfo getAccountInfo() throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {
final BitcoinCoreBalanceResponse balance = getBalance();
final BitcoinCoreBalanceResponse unconfirmed = getUnconfirmedBalance();
return BitcoinCoreAdapters.adaptAccountInfo(balance, unconfirmed);
}

@Override
public String withdrawFunds(Currency currency, BigDecimal amount, String address)
throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException {
public String withdrawFunds(Currency currency, BigDecimal amount,
String address) throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException {
throw new UnsupportedOperationException();
}

@Override
public String requestDepositAddress(Currency currency, String... args)
throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException {
public String requestDepositAddress(Currency currency,
String... args) throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException {
throw new UnsupportedOperationException();
}

Expand All @@ -48,7 +47,8 @@ public TradeHistoryParams createFundingHistoryParams() {
}

@Override
public List<FundingRecord> getFundingHistory(TradeHistoryParams params) throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {
public List<FundingRecord> getFundingHistory(
TradeHistoryParams params) throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {
throw new NotYetImplementedForExchangeException();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ public TradeHistoryParams createFundingHistoryParams() {
}

@Override
public List<FundingRecord> getFundingHistory(TradeHistoryParams params) throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {
public List<FundingRecord> getFundingHistory(
TradeHistoryParams params) throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {
throw new NotYetImplementedForExchangeException();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public interface Bitfinex {

@GET
@Path("book/{symbol}")
BitfinexDepth getBook(@PathParam("symbol") String symbol, @QueryParam("limit_bids") int limit_bids, @QueryParam("limit_asks") int limit_asks)
throws IOException, BitfinexException;
BitfinexDepth getBook(@PathParam("symbol") String symbol, @QueryParam("limit_bids") int limit_bids,
@QueryParam("limit_asks") int limit_asks) throws IOException, BitfinexException;

@GET
@Path("book/{symbol}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,13 +327,11 @@ public static List<FundingRecord> adaptFundingHistory(BitfinexDepositWithdrawalH
String description = responseEntry.getDescription();
String txnId = "";
final Currency currency = Currency.getInstance(responseEntry.getCurrency());
if (currency == Currency.BTC && responseEntry.getType() == FundingRecord.Type.WITHDRAWAL &&
description.contains(",")) {
if (currency == Currency.BTC && responseEntry.getType() == FundingRecord.Type.WITHDRAWAL && description.contains(",")) {
txnId = description.substring(description.indexOf("txid: ") + "txid: ".length());
}
FundingRecord fundingRecordEntry = new FundingRecord(address, responseEntry.getTimestamp(),
currency, responseEntry.getAmount(), txnId, responseEntry.getType(),
responseEntry.getStatus(), null, null, description);
FundingRecord fundingRecordEntry = new FundingRecord(address, responseEntry.getTimestamp(), currency, responseEntry.getAmount(), txnId,
responseEntry.getType(), responseEntry.getStatus(), null, null, description);

fundingRecords.add(fundingRecordEntry);
}
Expand Down
Loading

0 comments on commit 8dd1121

Please sign in to comment.