Package com.xeiam.xchange.coinfloor.dto.streaming.account

Examples of com.xeiam.xchange.coinfloor.dto.streaming.account.CoinfloorAssetBalance


  public Map<String, Object> adaptBalancesChanged(String data) {

    Map<String, Object> resultMap = new HashMap<String, Object>();

    CoinfloorAssetBalance rawRetObj;
    try {
      rawRetObj = streamObjectMapper.readValue(data, CoinfloorAssetBalance.class);
    } catch (IOException e) {
      throw new ExchangeException("JSON parse error", e);
    }

    List<Wallet> newWallets = new ArrayList<Wallet>();
    AccountInfo accountInfo;

    synchronized (cachedDataSynchronizationObject) {
      if (cachedAccountInfo == null) {
        String currency = rawRetObj.getAsset().toString();
        BigDecimal balance = rawRetObj.getBalance();

        newWallets.add(new Wallet(currency, balance));
      }
      else {
        List<Wallet> oldWallets = cachedAccountInfo.getWallets();
        for (Wallet wallet : oldWallets) {
          if (wallet.getCurrency().equals(rawRetObj.getAsset())) {
            String currency = rawRetObj.getAsset().toString();
            BigDecimal balance = rawRetObj.getBalance();

            newWallets.add(new Wallet(currency, balance));
          }
          else {
            newWallets.add(wallet);
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.coinfloor.dto.streaming.account.CoinfloorAssetBalance

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.