2017-09-13 16:12:22 +00:00
|
|
|
package cy.agorise.crystalwallet.enums;
|
|
|
|
|
|
|
|
import java.io.Serializable;
|
2017-10-18 00:35:37 +00:00
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
2017-09-13 16:12:22 +00:00
|
|
|
|
|
|
|
/**
|
2017-11-12 19:20:03 +00:00
|
|
|
* This represents each supported Crypto Coin
|
|
|
|
*
|
2017-09-13 16:12:22 +00:00
|
|
|
* Created by Henry Varona on 12/9/2017.
|
|
|
|
*/
|
|
|
|
|
|
|
|
public enum CryptoCoin implements Serializable {
|
2017-09-13 21:52:36 +00:00
|
|
|
BITCOIN(CryptoNet.BITCOIN,"BTC",8),
|
|
|
|
BITCOIN_TEST(CryptoNet.BITCOIN_TEST,"BTC",8),
|
|
|
|
LITECOIN(CryptoNet.LITECOIN,"LTC",8),
|
|
|
|
DASH(CryptoNet.DASH,"DASH",8),
|
|
|
|
DOGECOIN(CryptoNet.DOGECOIN,"DOGE",8),
|
2017-09-29 15:29:01 +00:00
|
|
|
BITSHARES(CryptoNet.BITSHARES,"BTS",5);
|
2017-09-13 16:12:22 +00:00
|
|
|
|
|
|
|
protected CryptoNet cryptoNet;
|
|
|
|
protected String label;
|
|
|
|
protected int precision;
|
|
|
|
|
2017-09-13 21:52:36 +00:00
|
|
|
CryptoCoin(CryptoNet cryptoNet, String label, int precision){
|
2017-09-13 16:12:22 +00:00
|
|
|
this.cryptoNet = cryptoNet;
|
|
|
|
this.label = label;
|
|
|
|
this.precision = precision;
|
2017-09-13 21:52:36 +00:00
|
|
|
|
2017-09-13 16:12:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public CryptoNet getCryptoNet(){
|
|
|
|
return this.cryptoNet;
|
|
|
|
}
|
|
|
|
public String getLabel(){
|
|
|
|
return this.label;
|
|
|
|
}
|
|
|
|
public int getPrecision(){
|
|
|
|
return this.precision;
|
|
|
|
}
|
2017-10-18 00:35:37 +00:00
|
|
|
public static List<CryptoCoin> getByCryptoNet(CryptoNet cryptoNet){
|
|
|
|
List<CryptoCoin> result = new ArrayList<CryptoCoin>();
|
|
|
|
|
|
|
|
for (CryptoCoin nextCryptoCoin : CryptoCoin.values()){
|
|
|
|
if (nextCryptoCoin.getCryptoNet().equals(cryptoNet)) {
|
|
|
|
result.add(nextCryptoCoin);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
2017-09-13 21:52:36 +00:00
|
|
|
|
2017-09-13 16:12:22 +00:00
|
|
|
}
|