From: Damyan Ivanov Date: Sat, 30 Jan 2021 21:07:23 +0000 (+0000) Subject: more toString() support X-Git-Tag: v0.17.0~194 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=423e6077aaa672ef1cb9e6c489c8144811f5c682;p=mobile-ledger.git more toString() support --- 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;