-
public class TransactionsFilter.Builder
A builder class for constructing a filter object. Follows the builder pattern.
Copyright 2017 Meniga Iceland Inc.
-
-
Constructor Summary
Constructors Constructor Description Builder()
Builder(TransactionsFilter filter)
-
Method Summary
Modifier and Type Method Description static TransactionsFilter.Builder
createBuilderFromExistingFilter(TransactionsFilter filterToCopy)
Takes in an TransactionFilter and copies its properties to a new builder TransactionsFilter.Builder
type(String type)
TransactionsFilter.Builder
orderBy(SeriesOrderBy order)
TransactionsFilter.Builder
ascendingOrder(boolean ascendingOrder)
TransactionsFilter.Builder
page(int numPerPage, int pageIndex)
How many results should be fetched in a page. TransactionsFilter.Builder
searchText(String searchText)
A free-form text to filter by that searches through transaction description, merchant name, category name, currency, tags comments and transaction data. TransactionsFilter.Builder
hideExcluded(boolean hideExcluded)
TransactionsFilter.Builder
useExactMerchantTexts(boolean useExactMerchantTexts)
A flag telling the selector to use exact merchant texts TransactionsFilter.Builder
uncertainOrFlagged(boolean uncertainOrFlagged)
Whether or not to get uncertain categorization or flagged transactions TransactionsFilter.Builder
useAbsoluteAmountSearch(boolean useAbsoluteAmountSearch)
Whether or not to use absolute amount search. TransactionsFilter.Builder
useAccentInsensitiveSearch(boolean useAccentInsensitiveSearch)
Whether the search performed is accent insensitive or not. TransactionsFilter.Builder
useAmountInCurrencySearch(boolean useAmountInCurrencySearch)
Whether or not to search for amount in currency instead of amount. TransactionsFilter.Builder
useAndSearchForTags(boolean useAndSearchForTags)
Whether or not tags are searched with AND or OR. TransactionsFilter.Builder
useEqualsSearchForBankId(boolean useEqualsSearchForBankId)
Whether or not BankId is searched with EQUALS or LIKE. TransactionsFilter.Builder
useExactDescription(boolean useExactDescription)
If true, filters by exact (equals) description as opposed to contains (which is the default). TransactionsFilter.Builder
useParentMerchantIds(boolean useParentMerchantIds)
If set to true, parent and the parents children will be found for each merchant id provided in MerchantIds and in ExcludeMerchantIds and theyincluded in the filter.If the merchant has no parent then its children, if any, are added. TransactionsFilter.Builder
onlyUncategorized(boolean onlyUncategorized)
Whether or not to only get uncategorized transactions. TransactionsFilter.Builder
amounts(MenigaDecimal from, MenigaDecimal to)
Amounts to search from and to. TransactionsFilter.Builder
categories(List<Long> categoryIds)
A list of category ids to filter by. TransactionsFilter.Builder
categories(ArrayList<MenigaCategory> categories)
A list of categories to filter by (will be converted to list of ids). TransactionsFilter.Builder
category(long categoryId)
A category id to filter by. TransactionsFilter.Builder
bankIds(List<String> bankIds)
List of bankid's to filter by. TransactionsFilter.Builder
categoryTypes(List<CategoryType> categoryTypes)
The category types to filter by. TransactionsFilter.Builder
categoryType(CategoryType categoryType)
The category type to filter by. TransactionsFilter.Builder
comment(String comment)
The transaction comment to filter by. TransactionsFilter.Builder
counterpartyAccountIdentifiers(List<String> counterpartyAccountIdentifiers)
The counterparty account identifers to filter by. TransactionsFilter.Builder
description(String description)
The transaction description to filter by. TransactionsFilter.Builder
excludeMerchantIds(List<Integer> excludeMerchantIds)
The merchant IDs to exclude. TransactionsFilter.Builder
excludeMerchantTexts(List<String> excludeMerchantTexts)
The merchant texts to exclude. TransactionsFilter.Builder
fields(List<String> fields)
A comma seperated list of what fields should be returned. TransactionsFilter.Builder
insertedBefore(DateTime insertedBefore)
If set, will only return transactions that have insert time before the supplied value. TransactionsFilter.Builder
accountIds(List<Long> accountIds)
A list of account ids to filter by. TransactionsFilter.Builder
accountTypeIds(List<Long> accountTypeIds)
A list of account types to filter by (current accounts, credit cards, saving accounts etc. TransactionsFilter.Builder
accounts(List<MenigaAccount> accounts)
A list of accounts to filter by. TransactionsFilter.Builder
account(long accountId)
A single account id to filter by. TransactionsFilter.Builder
accountIdentifiers(List<String> accountIdentifiers)
The account identifiers to filter by. TransactionsFilter.Builder
merchantIds(List<Long> merchantIds)
A list of merchant ids to filter by. TransactionsFilter.Builder
merchantId(long merchantId)
A single merchant id to filter by. TransactionsFilter.Builder
merchantTexts(List<String> merchantTexts)
A list of merchant texts to filter by TransactionsFilter.Builder
disableSkipTake()
TransactionsFilter.Builder
merchantText(String merchantText)
A single merchant text to filter by.Shorthand for using the merchantTexts method passing a list with a single entry. TransactionsFilter.Builder
tags(List<String> tags)
A list of tag strings to filter by. TransactionsFilter.Builder
tag(String tag)
A single tag to filter by TransactionsFilter.Builder
period(DateTime periodFrom, DateTime periodTo)
A period from and to, to filter by. TransactionsFilter.Builder
periodFrom(DateTime periodFrom)
A period from to filter by. TransactionsFilter.Builder
periodTo(DateTime periodTo)
A period to, to filter by. TransactionsFilter.Builder
originalPeriod(DateTime originalPeriodFrom, DateTime originalPeriodTo)
An original period from and to, to filter by. TransactionsFilter.Builder
parsedData(String parsedData)
The transaction data to filter by. TransactionsFilter.Builder
parsedDataExactKeys(List<String> parsedDataExactKeys)
List of keys in parsed data that should only return a match if the value is exactly the same as supplied in ParsedData. TransactionsFilter.Builder
parsedDataNameToOrderBy(String parsedDataNameToOrderBy)
The parsed data parameter to order by when orderBy = ByParsedData. TransactionsFilter.Builder
includeAccounts(boolean includeAccounts)
Flag for the option of getting the transaction accounts as a separate meta field TransactionsFilter.Builder
includeMerchants(boolean includeMerchants)
Flag for the option of getting the transaction merchants as a separate meta field TransactionsFilter.Builder
transactions(List<Long> transactionIds)
A list of transaction ids to filter by. TransactionsFilter.Builder
onlyUnread(boolean onlyUnread)
Filters transactions to only those that have been seen. TransactionsFilter.Builder
onlyFlagged(boolean onlyFlagged)
Filters transactions to only those that have been flagged. TransactionsFilter.Builder
onlyUncertain(boolean onlyUncertain)
Filters transactions to only those that are marked with uncertain categorization. TransactionsFilter.Builder
addSortAscending(TransactionSortField field)
TransactionsFilter.Builder
addSortAscending(String field)
TransactionsFilter.Builder
sortAscending(List<TransactionSortField> fields)
TransactionsFilter.Builder
addSortDescending(TransactionSortField field)
TransactionsFilter.Builder
addSortDescending(String field)
TransactionsFilter.Builder
sortDescending(List<TransactionSortField> fields)
TransactionsFilter.Builder
onlyUncleared(boolean onlyUncleared)
TransactionsFilter.Builder
mergeFilters(TransactionsFilter filter1, TransactionsFilter filter2)
Merges all the non null fields of two existing filters into the builder TransactionsFilter
build()
Builds the transaction filter. -
-
Constructor Detail
-
Builder
Builder()
-
Builder
Builder(TransactionsFilter filter)
-
-
Method Detail
-
createBuilderFromExistingFilter
static TransactionsFilter.Builder createBuilderFromExistingFilter(TransactionsFilter filterToCopy)
Takes in an TransactionFilter and copies its properties to a new builder
- Parameters:
filterToCopy
- existing transactionFilter
-
type
TransactionsFilter.Builder type(String type)
-
orderBy
TransactionsFilter.Builder orderBy(SeriesOrderBy order)
-
ascendingOrder
TransactionsFilter.Builder ascendingOrder(boolean ascendingOrder)
-
page
TransactionsFilter.Builder page(int numPerPage, int pageIndex)
How many results should be fetched in a page. Default value is 50
- Parameters:
numPerPage
- The number of items in the resultpageIndex
- The index of the page to retrieve
-
searchText
TransactionsFilter.Builder searchText(String searchText)
A free-form text to filter by that searches through transaction description, merchant name, category name, currency, tags comments and transaction data.
-
hideExcluded
TransactionsFilter.Builder hideExcluded(boolean hideExcluded)
-
useExactMerchantTexts
TransactionsFilter.Builder useExactMerchantTexts(boolean useExactMerchantTexts)
A flag telling the selector to use exact merchant texts
- Parameters:
useExactMerchantTexts
- Boolean to use exact merchant texts
-
uncertainOrFlagged
TransactionsFilter.Builder uncertainOrFlagged(boolean uncertainOrFlagged)
Whether or not to get uncertain categorization or flagged transactions
-
useAbsoluteAmountSearch
TransactionsFilter.Builder useAbsoluteAmountSearch(boolean useAbsoluteAmountSearch)
Whether or not to use absolute amount search.
-
useAccentInsensitiveSearch
TransactionsFilter.Builder useAccentInsensitiveSearch(boolean useAccentInsensitiveSearch)
Whether the search performed is accent insensitive or not.
-
useAmountInCurrencySearch
TransactionsFilter.Builder useAmountInCurrencySearch(boolean useAmountInCurrencySearch)
Whether or not to search for amount in currency instead of amount.
-
useAndSearchForTags
TransactionsFilter.Builder useAndSearchForTags(boolean useAndSearchForTags)
Whether or not tags are searched with AND or OR.
-
useEqualsSearchForBankId
TransactionsFilter.Builder useEqualsSearchForBankId(boolean useEqualsSearchForBankId)
Whether or not BankId is searched with EQUALS or LIKE. If true, exact matches are found, otherwise matches that contain the search string for BankId.
-
useExactDescription
TransactionsFilter.Builder useExactDescription(boolean useExactDescription)
If true, filters by exact (equals) description as opposed to contains (which is the default).
-
useParentMerchantIds
TransactionsFilter.Builder useParentMerchantIds(boolean useParentMerchantIds)
If set to true, parent and the parents children will be found for each merchant id provided in MerchantIds and in ExcludeMerchantIds and theyincluded in the filter.If the merchant has no parent then its children, if any, are added.
-
onlyUncategorized
TransactionsFilter.Builder onlyUncategorized(boolean onlyUncategorized)
Whether or not to only get uncategorized transactions.
-
amounts
TransactionsFilter.Builder amounts(MenigaDecimal from, MenigaDecimal to)
Amounts to search from and to.
-
categories
TransactionsFilter.Builder categories(List<Long> categoryIds)
A list of category ids to filter by.
-
categories
TransactionsFilter.Builder categories(ArrayList<MenigaCategory> categories)
A list of categories to filter by (will be converted to list of ids).
-
category
TransactionsFilter.Builder category(long categoryId)
A category id to filter by.
-
bankIds
TransactionsFilter.Builder bankIds(List<String> bankIds)
List of bankid's to filter by.
-
categoryTypes
TransactionsFilter.Builder categoryTypes(List<CategoryType> categoryTypes)
The category types to filter by.
-
categoryType
TransactionsFilter.Builder categoryType(CategoryType categoryType)
The category type to filter by.
-
comment
TransactionsFilter.Builder comment(String comment)
The transaction comment to filter by. If it's null, it will be ignored. But it is possible to search for empty comments.
-
counterpartyAccountIdentifiers
TransactionsFilter.Builder counterpartyAccountIdentifiers(List<String> counterpartyAccountIdentifiers)
The counterparty account identifers to filter by.
-
description
TransactionsFilter.Builder description(String description)
The transaction description to filter by. If it's null, it will be ignored. But it is possible to search for empty descriptions.
-
excludeMerchantIds
TransactionsFilter.Builder excludeMerchantIds(List<Integer> excludeMerchantIds)
The merchant IDs to exclude.
-
excludeMerchantTexts
TransactionsFilter.Builder excludeMerchantTexts(List<String> excludeMerchantTexts)
The merchant texts to exclude.
-
fields
TransactionsFilter.Builder fields(List<String> fields)
A comma seperated list of what fields should be returned.
-
insertedBefore
TransactionsFilter.Builder insertedBefore(DateTime insertedBefore)
If set, will only return transactions that have insert time before the supplied value.
-
accountIds
TransactionsFilter.Builder accountIds(List<Long> accountIds)
A list of account ids to filter by.
-
accountTypeIds
TransactionsFilter.Builder accountTypeIds(List<Long> accountTypeIds)
A list of account types to filter by (current accounts, credit cards, saving accounts etc.)
-
accounts
TransactionsFilter.Builder accounts(List<MenigaAccount> accounts)
A list of accounts to filter by.
-
account
TransactionsFilter.Builder account(long accountId)
A single account id to filter by. Same as calling accounts with a singleton list
-
accountIdentifiers
TransactionsFilter.Builder accountIdentifiers(List<String> accountIdentifiers)
The account identifiers to filter by.
-
merchantIds
TransactionsFilter.Builder merchantIds(List<Long> merchantIds)
A list of merchant ids to filter by.
-
merchantId
TransactionsFilter.Builder merchantId(long merchantId)
A single merchant id to filter by.
-
merchantTexts
TransactionsFilter.Builder merchantTexts(List<String> merchantTexts)
A list of merchant texts to filter by
-
disableSkipTake
TransactionsFilter.Builder disableSkipTake()
-
merchantText
TransactionsFilter.Builder merchantText(String merchantText)
A single merchant text to filter by.Shorthand for using the merchantTexts method passing a list with a single entry.
-
tags
TransactionsFilter.Builder tags(List<String> tags)
A list of tag strings to filter by.
-
tag
TransactionsFilter.Builder tag(String tag)
A single tag to filter by
-
period
TransactionsFilter.Builder period(DateTime periodFrom, DateTime periodTo)
A period from and to, to filter by.
-
periodFrom
TransactionsFilter.Builder periodFrom(DateTime periodFrom)
A period from to filter by.
-
periodTo
TransactionsFilter.Builder periodTo(DateTime periodTo)
A period to, to filter by.
-
originalPeriod
TransactionsFilter.Builder originalPeriod(DateTime originalPeriodFrom, DateTime originalPeriodTo)
An original period from and to, to filter by.
-
parsedData
TransactionsFilter.Builder parsedData(String parsedData)
The transaction data to filter by.
-
parsedDataExactKeys
TransactionsFilter.Builder parsedDataExactKeys(List<String> parsedDataExactKeys)
List of keys in parsed data that should only return a match if the value is exactly the same as supplied in ParsedData.
-
parsedDataNameToOrderBy
TransactionsFilter.Builder parsedDataNameToOrderBy(String parsedDataNameToOrderBy)
The parsed data parameter to order by when orderBy = ByParsedData.
-
includeAccounts
TransactionsFilter.Builder includeAccounts(boolean includeAccounts)
Flag for the option of getting the transaction accounts as a separate meta field
-
includeMerchants
TransactionsFilter.Builder includeMerchants(boolean includeMerchants)
Flag for the option of getting the transaction merchants as a separate meta field
-
transactions
TransactionsFilter.Builder transactions(List<Long> transactionIds)
A list of transaction ids to filter by.
-
onlyUnread
TransactionsFilter.Builder onlyUnread(boolean onlyUnread)
Filters transactions to only those that have been seen.
-
onlyFlagged
TransactionsFilter.Builder onlyFlagged(boolean onlyFlagged)
Filters transactions to only those that have been flagged.
-
onlyUncertain
TransactionsFilter.Builder onlyUncertain(boolean onlyUncertain)
Filters transactions to only those that are marked with uncertain categorization.
-
addSortAscending
TransactionsFilter.Builder addSortAscending(TransactionSortField field)
-
addSortAscending
TransactionsFilter.Builder addSortAscending(String field)
-
sortAscending
TransactionsFilter.Builder sortAscending(List<TransactionSortField> fields)
-
addSortDescending
TransactionsFilter.Builder addSortDescending(TransactionSortField field)
-
addSortDescending
TransactionsFilter.Builder addSortDescending(String field)
-
sortDescending
TransactionsFilter.Builder sortDescending(List<TransactionSortField> fields)
-
onlyUncleared
TransactionsFilter.Builder onlyUncleared(boolean onlyUncleared)
-
mergeFilters
TransactionsFilter.Builder mergeFilters(TransactionsFilter filter1, TransactionsFilter filter2)
Merges all the non null fields of two existing filters into the builder
- Parameters:
filter1
- Filter to merge non null fields number 1filter2
- Filter to merge non null fields number 2
-
build
TransactionsFilter build()
Builds the transaction filter.
-
-
-
-