From 423e6077aaa672ef1cb9e6c489c8144811f5c682 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Sat, 30 Jan 2021 21:07:23 +0000 Subject: [PATCH] more toString() support --- .../ktnx/mobileledger/model/PatternDetailsItem.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/model/PatternDetailsItem.java b/app/src/main/java/net/ktnx/mobileledger/model/PatternDetailsItem.java index 93528051..a5ec165c 100644 --- a/app/src/main/java/net/ktnx/mobileledger/model/PatternDetailsItem.java +++ b/app/src/main/java/net/ktnx/mobileledger/model/PatternDetailsItem.java @@ -237,6 +237,16 @@ abstract public class PatternDetailsItem { public void switchToLiteral() { literalValue = true; } + public String toString() { + if (literalValue) + if (value == null) + return ""; + else + return value.toString(); + if (matchGroup > 0) + return "grp:" + matchGroup; + return ""; + } } public static class TYPE { @@ -413,7 +423,8 @@ abstract public class PatternDetailsItem { @Override public String toString() { return super.toString() + - String.format(" name[%s] pat[%s] test[%s]", name, pattern, testText); + String.format(" name[%s] pat[%s] test[%s] tran[%s] com[%s]", name, pattern, + testText, transactionDescription, transactionComment); } public String getTestText() { return testText; -- 2.39.5