1 package org.oxerr.chbtc.dto;
2
3 import java.io.UnsupportedEncodingException;
4 import java.math.BigDecimal;
5 import java.net.URLDecoder;
6
7 import com.fasterxml.jackson.annotation.JsonProperty;
8
9 public class Balance extends BaseObject {
10
11 private static final long serialVersionUID = 2014063001L;
12
13
14
15
16 private final String currency;
17
18
19
20
21 private final String symbol;
22
23
24
25
26 private final BigDecimal amount;
27
28
29
30
31
32
33
34
35 public Balance(
36 @JsonProperty("currency") final String currency,
37 @JsonProperty("symbol") final String symbol,
38 @JsonProperty("amount") final BigDecimal amount) {
39 this.currency = currency;
40 try {
41 this.symbol = URLDecoder.decode(symbol, "UTF-8");
42 } catch (UnsupportedEncodingException e) {
43 throw new RuntimeException(e);
44 }
45 this.amount = amount;
46 }
47
48
49
50
51
52
53 public String getCurrency() {
54 return currency;
55 }
56
57
58
59
60
61
62 public String getSymbol() {
63 return symbol;
64 }
65
66
67
68
69
70
71 public BigDecimal getAmount() {
72 return amount;
73 }
74
75 }