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

147 lines
2.9 KiB
Java
Raw Normal View History

package cy.agorise.crystalwallet.models;
import android.arch.persistence.room.ColumnInfo;
import android.arch.persistence.room.Entity;
import android.arch.persistence.room.PrimaryKey;
import java.util.Date;
import cy.agorise.crystalwallet.enums.CryptoCoin;
/**
2017-09-13 21:52:36 +00:00
* Represents a generic CryptoNet Transaction
*
* Created by Henry Varona on 11/9/2017.
*/
@Entity(tableName="crypto_coin_transaction")
public class CryptoCoinTransaction {
2017-09-13 21:52:36 +00:00
/**
* The account associated with this transaction
*/
protected CryptoNetAccount account;
2017-09-13 21:52:36 +00:00
/**
* The id on the database
*/
@PrimaryKey(autoGenerate = true)
@ColumnInfo(name="id")
protected int id;
2017-09-13 21:52:36 +00:00
/**
* The full date of this transaction
*/
@ColumnInfo(name="date")
protected Date date;
2017-09-13 21:52:36 +00:00
/**
* If this transaction is input of the account associated with it
*/
@ColumnInfo(name="is_input")
protected boolean isInput;
2017-09-13 21:52:36 +00:00
/**
* The id of the account assoiciated, this is used for the foreign key definition
*/
@ColumnInfo(name="account_id")
protected int accountId;
2017-09-13 21:52:36 +00:00
/**
* The amount of asset is moved in this transaction
*/
@ColumnInfo(name="amount")
protected int amount;
2017-09-14 02:09:58 +00:00
public CryptoCoin getCoin() {
return coin;
}
public void setCoin(CryptoCoin coin) {
this.coin = coin;
}
public boolean isConfirmed() {
return isConfirmed;
}
public void setConfirmed(boolean confirmed) {
isConfirmed = confirmed;
}
2017-09-13 21:52:36 +00:00
/**
* The crypto Coin associated with this transaction
*/
@ColumnInfo(name="crypto_coin")
protected CryptoCoin coin;
2017-09-13 21:52:36 +00:00
/**
* If this transaction is confirmed
*/
@ColumnInfo(name="is_confirmed")
protected boolean isConfirmed;
public int getAmount() {
return amount;
}
public void setAmount(int amount) {
this.amount = amount;
}
@ColumnInfo(name="from")
protected String from;
@ColumnInfo(name="to")
protected String to;
public String getFrom() {
return from;
}
public void setFrom(String from) {
this.from = from;
}
public String getTo() {
return to;
}
public void setTo(String to) {
this.to = to;
}
public int getAccountId() {
return accountId;
}
public void setAccountId(int accountId) {
this.accountId = accountId;
}
public CryptoNetAccount getAccount() {
return account;
}
public void setAccount(CryptoNetAccount account) {
this.account = account;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public boolean getInput() {
return isInput;
}
public void setInput(boolean input) {
this.isInput = input;
}
}