View Javadoc
1   package org.oxerr.peatio.rest.dto;
2   
3   import java.math.BigDecimal;
4   import java.util.Date;
5   
6   import org.oxerr.peatio.rest.Peatio;
7   
8   import com.fasterxml.jackson.annotation.JsonFormat;
9   import com.fasterxml.jackson.annotation.JsonProperty;
10  
11  public class Trade extends BaseObject {
12  
13  	private final long id;
14  	private final BigDecimal price;
15  	private final BigDecimal volume;
16  	private final BigDecimal funds;
17  	private final String market;
18  	private final Date createdAt;
19  	private final String side;
20  	private final Long orderId;
21  
22  	/**
23  	 *
24  	 * @param id unique ID.
25  	 * @param price trade price.
26  	 * @param volume trade volume.
27  	 * @param funds the funds.
28  	 * @param market the market trade belongs to, like 'btccny'.
29  	 * @param createdAt trade time.
30  	 * @param side the side.
31  	 * @param orderId my order ID related to this trade.
32  	 * Only {@link Peatio#getMyTrades} returns this field,
33  	 * indicates which order this trade belongs to.
34  	 */
35  	public Trade(
36  			@JsonProperty("id") long id,
37  			@JsonProperty("price") BigDecimal price,
38  			@JsonProperty("volume") BigDecimal volume,
39  			@JsonProperty("funds") BigDecimal funds,
40  			@JsonProperty("market") String market,
41  			@JsonProperty("created_at")
42  			@JsonFormat(pattern="yyyy-MM-dd'T'HH:mm:ssXXX") Date createdAt,
43  			@JsonProperty("side") String side,
44  			@JsonProperty("order_id") Long orderId) {
45  		this.id = id;
46  		this.price = price;
47  		this.volume = volume;
48  		this.funds = funds;
49  		this.market = market;
50  		this.createdAt = createdAt;
51  		this.side = side;
52  		this.orderId = orderId;
53  	}
54  
55  	public long getId() {
56  		return id;
57  	}
58  
59  	public BigDecimal getPrice() {
60  		return price;
61  	}
62  
63  	public BigDecimal getVolume() {
64  		return volume;
65  	}
66  
67  	public BigDecimal getFunds() {
68  		return funds;
69  	}
70  
71  	public String getMarket() {
72  		return market;
73  	}
74  
75  	public Date getCreatedAt() {
76  		return createdAt;
77  	}
78  
79  	public String getSide() {
80  		return side;
81  	}
82  
83  	public Long getOrderId() {
84  		return orderId;
85  	}
86  
87  }