1 package org.oxerr.okcoin.rest.dto;
2
3 import java.math.BigDecimal;
4 import java.util.Collections;
5 import java.util.Map;
6
7 import com.fasterxml.jackson.annotation.JsonProperty;
8
9 public class Funds extends BaseObject {
10
11 private static final long serialVersionUID = 20140614L;
12
13 private final Map<String, BigDecimal> asset;
14 private final Map<String, BigDecimal> borrow;
15 private final Map<String, BigDecimal> free;
16 private final Map<String, BigDecimal> frozen;
17 private final Map<String, BigDecimal> unionFund;
18
19 public Funds(
20 @JsonProperty("asset") final Map<String, BigDecimal> asset,
21 @JsonProperty("borrow") final Map<String, BigDecimal> borrow,
22 @JsonProperty("free") final Map<String, BigDecimal> free,
23 @JsonProperty("freezed") final Map<String, BigDecimal> frozen,
24 @JsonProperty("union_fund") final Map<String, BigDecimal> unionFund) {
25 this.asset = nonNull(asset);
26 this.borrow = nonNull(borrow);
27 this.free = nonNull(free);
28 this.frozen = nonNull(frozen);
29 this.unionFund = nonNull(unionFund);
30 }
31
32 private static Map<String, BigDecimal> nonNull(final Map<String, BigDecimal> map) {
33 return map == null ? Collections.emptyMap() : map;
34 }
35
36
37
38
39
40
41 public Map<String, BigDecimal> getAsset() {
42 return asset;
43 }
44
45
46
47
48
49
50
51 public Map<String, BigDecimal> getBorrow() {
52 return borrow;
53 }
54
55
56
57
58
59
60 public Map<String, BigDecimal> getFree() {
61 return free;
62 }
63
64
65
66
67
68
69 public Map<String, BigDecimal> getFrozen() {
70 return frozen;
71 }
72
73
74
75
76
77
78
79 public Map<String, BigDecimal> getUnionFund() {
80 return unionFund;
81 }
82
83 }