this.templateId = templateId;
this.position = position;
}
+ public TemplateAccount(TemplateAccount o) {
+ id = o.id;
+ templateId = o.templateId;
+ accountName = o.accountName;
+ position = o.position;
+ accountNameMatchGroup = o.accountNameMatchGroup;
+ currency = o.currency;
+ currencyMatchGroup = o.currencyMatchGroup;
+ amount = o.amount;
+ amountMatchGroup = o.amountMatchGroup;
+ accountComment = o.accountComment;
+ accountCommentMatchGroup = o.accountCommentMatchGroup;
+ negateAmount = o.negateAmount;
+ }
public Long getId() {
return id;
}
this.name = name;
this.regularExpression = regularExpression;
}
+ public TemplateHeader(TemplateHeader origin) {
+ id = origin.id;
+ name = origin.name;
+ regularExpression = origin.regularExpression;
+ testText = origin.testText;
+ transactionDescription = origin.transactionDescription;
+ transactionDescriptionMatchGroup = origin.transactionDescriptionMatchGroup;
+ transactionComment = origin.transactionComment;
+ transactionCommentMatchGroup = origin.transactionCommentMatchGroup;
+ dateYear = origin.dateYear;
+ dateYearMatchGroup = origin.dateYearMatchGroup;
+ dateMonth = origin.dateMonth;
+ dateMonthMatchGroup = origin.dateMonthMatchGroup;
+ dateDay = origin.dateDay;
+ dateDayMatchGroup = origin.dateDayMatchGroup;
+ }
public String getTestText() {
return testText;
}
import androidx.room.Embedded;
import androidx.room.Relation;
+import java.util.ArrayList;
import java.util.List;
public class TemplateWithAccounts {
@Relation(parentColumn = "id", entityColumn = "template_id")
public List<TemplateAccount> accounts;
+ public static TemplateWithAccounts from(TemplateWithAccounts o) {
+ TemplateWithAccounts result = new TemplateWithAccounts();
+ result.header = new TemplateHeader(o.header);
+ result.accounts = new ArrayList<>();
+ for (TemplateAccount acc : o.accounts) {
+ result.accounts.add(new TemplateAccount(acc));
+ }
+
+ return result;
+ }
public Long getId() {
return header.getId();
}