All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.xeiam.xchange.loyalbit.dto.marketdata.LoyalbitOrderBook Maven / Gradle / Ivy

The newest version!
package com.xeiam.xchange.loyalbit.dto.marketdata;

import java.math.BigDecimal;
import java.util.List;
import java.util.Objects;

import com.fasterxml.jackson.annotation.JsonProperty;

import si.mazi.rescu.ExceptionalReturnContentException;

/**
 * @author Matija Mazi
 */
public class LoyalbitOrderBook {

  private final List> bids;
  private final List> asks;

  public LoyalbitOrderBook(@JsonProperty("bids") List> bids, @JsonProperty("asks") List> asks,
      @JsonProperty("status") Integer status) throws ExceptionalReturnContentException {
    if (Objects.equals(status, 0)) {
      throw new ExceptionalReturnContentException("Status indicates failure: " + status);
    }
    this.bids = bids;
    this.asks = asks;
  }

  /** (price, amount) */
  public List> getBids() {

    return bids;
  }

  /** (price, amount) */
  public List> getAsks() {

    return asks;
  }

  @Override
  public String toString() {
    return "LoyalbitOrderBook [bids=" + bids + ", asks=" + asks + "]";
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy