/
AnalysisTagConfig.java
110 lines (88 loc) 路 2.56 KB
/
AnalysisTagConfig.java
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
package openfoodfacts.github.scrachx.openfood.models.entities.analysistagconfig;
import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Index;
import org.greenrobot.greendao.annotation.Keep;
import org.greenrobot.greendao.annotation.Transient;
import openfoodfacts.github.scrachx.openfood.models.entities.analysistag.AnalysisTagName;
@Entity
public class AnalysisTagConfig {
@Id(autoincrement = true)
private Long id;
@Index
private String analysisTag;
private String type;
@Transient
private String typeName;
private String icon;
private String color;
@Transient
private AnalysisTagName name;
@Generated(hash = 492427864)
public AnalysisTagConfig(Long id, String analysisTag, String type, String icon, String color) {
this.id = id;
this.analysisTag = analysisTag;
this.type = type;
this.icon = icon;
this.color = color;
}
@Keep
public AnalysisTagConfig(String analysisTag, String type, String icon, String color) {
this.analysisTag = analysisTag;
this.type = type;
this.icon = icon;
this.color = color;
}
@Generated(hash = 104416516)
public AnalysisTagConfig() {
}
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public String getAnalysisTag() {
return this.analysisTag;
}
public void setAnalysisTag(String analysisTag) {
this.analysisTag = analysisTag;
}
public String getIcon() {
return icon;
}
public String getIconUrl() {
return "https://static.openfoodfacts.org/images/icons/" + icon + ".white.96x96.png";
}
public void setIcon(String icon) {
this.icon = icon;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
public String getType() {
return this.type;
}
public void setType(String type) {
this.type = type;
}
public boolean isNotNull() {
return analysisTag != null && type != null && icon != null && color != null;
}
public AnalysisTagName getName() {
return name;
}
public void setName(AnalysisTagName name) {
this.name = name;
}
public void setTypeName(String typeName) {
this.typeName = typeName;
}
public String getTypeName() {
return this.typeName;
}
}