crystal-wallet-android/app/src/main/java/cy/agorise/crystalwallet/models/CryptoCurrency.java

89 lines
1.9 KiB
Java
Raw Normal View History

2017-09-13 21:52:36 +00:00
package cy.agorise.crystalwallet.models;
2017-09-14 03:13:37 +00:00
import android.arch.persistence.room.ColumnInfo;
2017-09-25 02:59:46 +00:00
import android.arch.persistence.room.Entity;
import android.arch.persistence.room.Index;
2017-09-14 03:13:37 +00:00
import android.arch.persistence.room.PrimaryKey;
import android.arch.persistence.room.TypeConverters;
import cy.agorise.crystalwallet.dao.converters.Converters;
import cy.agorise.crystalwallet.enums.CryptoNet;
2017-09-13 21:52:36 +00:00
/**
2017-09-25 02:59:46 +00:00
* Represents each currency in transaction and balances
2017-09-13 21:52:36 +00:00
*
* Created by henry Henry Varona on 11/9/2017.
*/
@Entity(tableName="crypto_currency",
indices = {@Index(value = {"crypto_net","name"}, unique=true)})
2017-09-25 02:59:46 +00:00
public class CryptoCurrency {
2017-09-14 03:13:37 +00:00
/**
* The id on the database
*/
@PrimaryKey(autoGenerate = true)
@ColumnInfo(name = "id")
2017-11-02 02:31:31 +00:00
private long mId;
2017-09-14 03:13:37 +00:00
/**
2017-09-25 02:59:46 +00:00
* The name or tag of this currency
2017-09-14 03:13:37 +00:00
*/
@ColumnInfo(name = "name")
private String mName;
/**
2017-09-25 02:59:46 +00:00
* CryptoCoin network where this currency belongs to
2017-09-14 03:13:37 +00:00
*/
2017-09-25 02:59:46 +00:00
@ColumnInfo(name = "crypto_net")
@TypeConverters(Converters.class)
2017-09-14 03:13:37 +00:00
private CryptoNet mCryptoNet;
/**
* The decimal point
*/
@ColumnInfo(name = "precision")
private int mPrecision;
public CryptoCurrency() {
}
public CryptoCurrency(String name, CryptoNet cryptoNet, int precision) {
this.mName = name;
this.mCryptoNet = cryptoNet;
this.mPrecision = precision;
}
2017-11-02 02:31:31 +00:00
public long getId() {
2017-09-14 03:13:37 +00:00
return mId;
}
2017-11-02 02:31:31 +00:00
public void setId(long mId) {
2017-09-14 03:13:37 +00:00
this.mId = mId;
}
public String getName() {
return mName;
}
public void setName(String mName) {
this.mName = mName;
}
public CryptoNet getCryptoNet() {
return mCryptoNet;
}
public void setCryptoNet(CryptoNet cryptoNet) {
this.mCryptoNet = cryptoNet;
}
public int getPrecision() {
return mPrecision;
}
public void setPrecision(int precision) {
this.mPrecision = precision;
}
2017-09-13 21:52:36 +00:00
}