-
- All Implemented Interfaces:
-
android.os.Parcelable,java.io.Serializable,java.lang.Cloneable
public class MenigaNetWorth implements Serializable, Parcelable, Cloneable
Represents a net worth account in the Meniga system. A net worth account are things like mortgages, savings accounts, stock accounts etc.
Copyright 2017 Meniga Iceland Inc.
-
-
Field Summary
Fields Modifier and Type Field Description public final static Parcelable.Creator<MenigaNetWorth>CREATORprotected LongrealmAccountTypeIdprotected BooleanisImportprotected BooleanisManualprotected BooleanisExcludedprotected NetWorthTypenetWorthTypeprotected MenigaDecimalcurrentBalanceprotected List<MenigaNetWorthBalance>historyprotected MenigaNetWorthAccountTypeaccountType
-
Method Summary
Modifier and Type Method Description static voidsetOperator(MenigaNetWorthOperations operator)Sets the api operator for doing api calls voidwriteToParcel(Parcel dest, int flags)MenigaNetWorthclone()intdescribeContents()longgetId()StringgetName()voidsetName(String name)booleanequals(Object o)inthashCode()StringtoString()Result<Void>delete()Deletes this NetWorth account Result<Void>update()Updates this net worth object and persists changes made using setters. Result<List<MenigaNetWorth>>refresh()Fetches the server version of this object and updates all fields in this object with the server values, essentially syncing it with the server static Result<MenigaNetWorth>fetch(long id)static Result<List<MenigaNetWorth>>fetch(DateTime startDate, DateTime endDate, int skip, int take)Get net worth. static Result<List<MenigaNetWorth>>fetchSummary(DateTime startDate, DateTime endDate, int skip, int take)Get net worth summary. static Result<MenigaNetWorth>create(MenigaDecimal initialBalance, MenigaDecimal currentBalance, String accountIdentifier, String name, NetWorthType networthType, DateTime initialBalanceDate)Create manual net worth account. static Result<MenigaNetWorthBalance>fetchFirstBalanceEntry(boolean excludeAccountsExcludedFromNetWorth)Get the first account balance history entry date. static Result<List<KeyVal<Long, String>>>fetchNetWorthTypes()Retrieves all NetWorth types LonggetRealmAccountTypeId()BooleangetIsImport()BooleangetIsManual()NetWorthTypegetNetWorthType()MenigaDecimalgetCurrentBalance()List<MenigaNetWorthBalance>getHistory()MenigaNetWorthAccountTypegetAccountType()voidsetIsExcluded(Boolean isExcluded)voidsetCurrentBalance(MenigaDecimal currentBalance)-
-
Method Detail
-
setOperator
static void setOperator(MenigaNetWorthOperations operator)
Sets the api operator for doing api calls
- Parameters:
operator- An object that implements the MenigaNetWorthOperations interface for carrying out api operations on this class.
-
writeToParcel
void writeToParcel(Parcel dest, int flags)
-
clone
MenigaNetWorth clone()
-
describeContents
int describeContents()
-
getId
long getId()
-
hashCode
int hashCode()
-
refresh
Result<List<MenigaNetWorth>> refresh()
Fetches the server version of this object and updates all fields in this object with the server values, essentially syncing it with the server
-
fetch
static Result<MenigaNetWorth> fetch(long id)
-
fetch
static Result<List<MenigaNetWorth>> fetch(DateTime startDate, DateTime endDate, int skip, int take)
Get net worth. Unknown account types are ignored.
- Parameters:
startDate- The start date and timeendDate- The end date and timeskip- How many accounts should be skippedtake- How many accounts should be fetched.
-
fetchSummary
static Result<List<MenigaNetWorth>> fetchSummary(DateTime startDate, DateTime endDate, int skip, int take)
Get net worth summary. Unknown account types are ignored.
- Parameters:
startDate- The start date and timeendDate- The end date and timeskip- How many accounts should be skipped.take- How many accounts should be fetched.
-
create
static Result<MenigaNetWorth> create(MenigaDecimal initialBalance, MenigaDecimal currentBalance, String accountIdentifier, String name, NetWorthType networthType, DateTime initialBalanceDate)
Create manual net worth account.
- Parameters:
initialBalance- The initial balance of the account.currentBalance- Current balance of the account.accountIdentifier- Identifier for the account set by the originating bank.name- The display name of the account.initialBalanceDate- The initial balance date of the account.
-
fetchFirstBalanceEntry
static Result<MenigaNetWorthBalance> fetchFirstBalanceEntry(boolean excludeAccountsExcludedFromNetWorth)
Get the first account balance history entry date. Useful e.g. for creating graphs
- Parameters:
excludeAccountsExcludedFromNetWorth- Indicates if excluded accounts should be included
-
fetchNetWorthTypes
static Result<List<KeyVal<Long, String>>> fetchNetWorthTypes()
Retrieves all NetWorth types
-
getRealmAccountTypeId
Long getRealmAccountTypeId()
-
getIsImport
Boolean getIsImport()
-
getIsManual
Boolean getIsManual()
-
getNetWorthType
NetWorthType getNetWorthType()
-
getCurrentBalance
MenigaDecimal getCurrentBalance()
-
getHistory
List<MenigaNetWorthBalance> getHistory()
-
getAccountType
MenigaNetWorthAccountType getAccountType()
-
setIsExcluded
void setIsExcluded(Boolean isExcluded)
- Parameters:
isExcluded- Set if the NetWorth should be excluded or not.
-
setCurrentBalance
void setCurrentBalance(MenigaDecimal currentBalance)
- Parameters:
currentBalance- Sets the current balance of this NetWorth.
-
-
-
-