]> git.ktnx.net Git - mobile-ledger.git/blob - app/src/main/java/net/ktnx/mobileledger/db/PatternAccount.java
drop redundant parameter with default value
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / db / PatternAccount.java
1 /*
2  * Copyright © 2021 Damyan Ivanov.
3  * This file is part of MoLe.
4  * MoLe is free software: you can distribute it and/or modify it
5  * under the term of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your opinion), any later version.
8  *
9  * MoLe is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License terms for details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with MoLe. If not, see <https://www.gnu.org/licenses/>.
16  */
17
18 package net.ktnx.mobileledger.db;
19
20 import androidx.annotation.NonNull;
21 import androidx.room.ColumnInfo;
22 import androidx.room.Entity;
23 import androidx.room.ForeignKey;
24 import androidx.room.Index;
25 import androidx.room.PrimaryKey;
26
27 import org.jetbrains.annotations.NotNull;
28
29 @Entity(tableName = "pattern_accounts",
30         indices = {@Index(name = "un_pattern_accounts", unique = true, value = "id"),
31                    @Index(name = "fk_pattern_accounts_pattern", value = "pattern_id"),
32                    @Index(name = "fk_pattern_accounts_currency", value = "currency")
33         }, foreignKeys = {@ForeignKey(childColumns = "pattern_id", parentColumns = "id",
34                                       entity = PatternHeader.class),
35                           @ForeignKey(childColumns = "currency", parentColumns = "id",
36                                       entity = Currency.class)
37 })
38 public class PatternAccount extends PatternBase {
39     @NonNull
40     @ColumnInfo(name = "pattern_id")
41     private Long patternId;
42     @PrimaryKey(autoGenerate = true)
43     @NotNull
44     private Long id;
45     @ColumnInfo(name = "acc")
46     private String accountName;
47     @ColumnInfo(name = "position")
48     @NonNull
49     private Long position;
50     @ColumnInfo(name = "acc_match_group")
51     private Integer accountNameMatchGroup;
52     @ColumnInfo(name = "currency")
53     private Integer currency;
54     @ColumnInfo(name = "currency_match_group")
55     private Integer currencyMatchGroup;
56     @ColumnInfo(name = "amount")
57     private Float amount;
58     @ColumnInfo(name = "amount_match_group")
59     private Integer amountMatchGroup;
60     @ColumnInfo(name = "comment")
61     private String accountComment;
62     @ColumnInfo(name = "comment_match_group")
63     private Integer accountCommentMatchGroup;
64     public PatternAccount(@NotNull Long id, @NonNull Long patternId, @NonNull Long position) {
65         this.id = id;
66         this.patternId = patternId;
67         this.position = position;
68     }
69     public Long getId() {
70         return id;
71     }
72     public void setId(Long id) {
73         this.id = id;
74     }
75     public @NotNull Long getPatternId() {
76         return patternId;
77     }
78     public void setPatternId(@NonNull Long patternId) {
79         this.patternId = patternId;
80     }
81     @NonNull
82     public String getAccountName() {
83         return accountName;
84     }
85     public void setAccountName(@NonNull String accountName) {
86         this.accountName = accountName;
87     }
88     @NonNull
89     public Long getPosition() {
90         return position;
91     }
92     public void setPosition(@NonNull Long position) {
93         this.position = position;
94     }
95     public void setPosition(int position) {
96         this.position = (long) position;
97     }
98     public Integer getAccountNameMatchGroup() {
99         return accountNameMatchGroup;
100     }
101     public void setAccountNameMatchGroup(Integer accountNameMatchGroup) {
102         this.accountNameMatchGroup = accountNameMatchGroup;
103     }
104     public Integer getCurrency() {
105         return currency;
106     }
107     public void setCurrency(Integer currency) {
108         this.currency = currency;
109     }
110     public Integer getCurrencyMatchGroup() {
111         return currencyMatchGroup;
112     }
113     public void setCurrencyMatchGroup(Integer currencyMatchGroup) {
114         this.currencyMatchGroup = currencyMatchGroup;
115     }
116     public Float getAmount() {
117         return amount;
118     }
119     public void setAmount(Float amount) {
120         this.amount = amount;
121     }
122     public Integer getAmountMatchGroup() {
123         return amountMatchGroup;
124     }
125     public void setAmountMatchGroup(Integer amountMatchGroup) {
126         this.amountMatchGroup = amountMatchGroup;
127     }
128     public String getAccountComment() {
129         return accountComment;
130     }
131     public void setAccountComment(String accountComment) {
132         this.accountComment = accountComment;
133     }
134     public Integer getAccountCommentMatchGroup() {
135         return accountCommentMatchGroup;
136     }
137     public void setAccountCommentMatchGroup(Integer accountCommentMatchGroup) {
138         this.accountCommentMatchGroup = accountCommentMatchGroup;
139     }
140 }