|
12 | 12 | import org.hamcrest.Matcher; |
13 | 13 | import org.hamcrest.TypeSafeDiagnosingMatcher; |
14 | 14 |
|
| 15 | +import name.abuchen.portfolio.datatransfer.Extractor.AccountTransferItem; |
15 | 16 | import name.abuchen.portfolio.datatransfer.Extractor.BuySellEntryItem; |
16 | 17 | import name.abuchen.portfolio.datatransfer.Extractor.PortfolioTransferItem; |
17 | 18 | import name.abuchen.portfolio.datatransfer.Extractor.SecurityItem; |
18 | 19 | import name.abuchen.portfolio.datatransfer.Extractor.TransactionItem; |
19 | 20 | import name.abuchen.portfolio.model.AccountTransaction; |
| 21 | +import name.abuchen.portfolio.model.AccountTransferEntry; |
20 | 22 | import name.abuchen.portfolio.model.BuySellEntry; |
21 | 23 | import name.abuchen.portfolio.model.PortfolioTransaction; |
22 | 24 | import name.abuchen.portfolio.model.PortfolioTransferEntry; |
@@ -233,6 +235,28 @@ public static Matcher<Extractor.Item> feeRefund(Matcher<Transaction>... properti |
233 | 235 | return new AccountTransactionMatcher("fee refund", AccountTransaction.Type.FEES_REFUND, properties); //$NON-NLS-1$ |
234 | 236 | } |
235 | 237 |
|
| 238 | + @SafeVarargs |
| 239 | + public static Matcher<Extractor.Item> inboundCash(Matcher<Transaction>... properties) |
| 240 | + { |
| 241 | + return new ExtractorItemMatcher<Transaction>("cash transfer", //$NON-NLS-1$ |
| 242 | + item -> item instanceof AccountTransferItem transfer // |
| 243 | + && transfer.getSubject() instanceof AccountTransferEntry entry |
| 244 | + ? entry.getTargetTransaction() |
| 245 | + : null, // |
| 246 | + properties); |
| 247 | + } |
| 248 | + |
| 249 | + @SafeVarargs |
| 250 | + public static Matcher<Extractor.Item> outboundCash(Matcher<Transaction>... properties) |
| 251 | + { |
| 252 | + return new ExtractorItemMatcher<Transaction>("cash transfer", //$NON-NLS-1$ |
| 253 | + item -> item instanceof AccountTransferItem transfer // |
| 254 | + && transfer.getSubject() instanceof AccountTransferEntry entry |
| 255 | + ? entry.getSourceTransaction() |
| 256 | + : null, // |
| 257 | + properties); |
| 258 | + } |
| 259 | + |
236 | 260 | @SafeVarargs |
237 | 261 | public static Matcher<Extractor.Item> purchase(Matcher<Transaction>... properties) |
238 | 262 | { |
|
0 commit comments