blob: f561f638c6e46b369de55d80efd2751a63f70068 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
package it.niedermann.owncloud.notes.widget;
import androidx.annotation.IntRange;
import androidx.room.PrimaryKey;
public abstract class AbstractWidgetData {
@PrimaryKey
private int id;
private long accountId;
@IntRange(from = 0, to = 2)
private int themeMode;
protected AbstractWidgetData() {
// Default constructor
}
protected AbstractWidgetData(int id, long accountId, @IntRange(from = 0, to = 2) int themeMode) {
this.id = id;
this.accountId = accountId;
this.themeMode = themeMode;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public long getAccountId() {
return accountId;
}
public void setAccountId(long accountId) {
this.accountId = accountId;
}
@IntRange(from = 0, to = 2)
public int getThemeMode() {
return themeMode;
}
public void setThemeMode(@IntRange(from = 0, to = 2) int themeMode) {
this.themeMode = themeMode;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof AbstractWidgetData)) return false;
AbstractWidgetData that = (AbstractWidgetData) o;
if (id != that.id) return false;
if (accountId != that.accountId) return false;
return themeMode == that.themeMode;
}
@Override
public int hashCode() {
int result = id;
result = 31 * result + (int) (accountId ^ (accountId >>> 32));
result = 31 * result + themeMode;
return result;
}
}
|