-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFontEntity.java
More file actions
211 lines (183 loc) · 5.31 KB
/
FontEntity.java
File metadata and controls
211 lines (183 loc) · 5.31 KB
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
package net.onelitefeather.vulpes.api.model;
import jakarta.persistence.ElementCollection;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import net.onelitefeather.vulpes.api.generator.VulpesGenerator;
import java.util.List;
import java.util.UUID;
/**
* Represents a Font in the system. This class is used as an entity for persistence
* with JPA and Micronaut Data. It contains details related to a font such as name,
* type, ascent, height, etc.
* <p>
* This class is mapped to the database table "vulpes_fonts" and contains fields that
* are automatically persisted by the JPA and Micronaut Data layers.
* </p>
*/
@Entity(name = "fonts")
public class FontEntity implements VulpesModel {
@Id
@GeneratedValue(strategy = GenerationType.UUID)
@VulpesGenerator
private UUID id;
private String uiName;
private String variableName;
private String provider;
private String mapper = "font";
private String texturePath;
private String comment;
private int height;
private int ascent;
@ElementCollection
private List<String> chars;
/**
* Default constructor for JPA and Micronaut Data.
* <p>
* This constructor is required for the JPA provider to instantiate the entity.
* </p>
*/
public FontEntity() {
// No-argument constructor for JPA
}
/**
* Constructs a new {@link FontEntity} with the specified values.
*
* @param id the unique identifier of the font
* @param uiName the user interface name of the font
* @param variableName the variable name of the font
* @param provider the provider of the font
* @param texturePath the path to the texture of the font
* @param height the height of the font
* @param ascent the ascent of the font
* @param chars the list of characters included in the font
*/
public FontEntity(UUID id, String uiName, String variableName, String provider, String texturePath, String comment, int height, int ascent, List<String> chars) {
this.id = id;
this.uiName = uiName;
this.variableName = variableName;
this.provider = provider;
this.texturePath = texturePath;
this.comment = comment;
this.height = height;
this.ascent = ascent;
this.chars = chars;
}
// Getters and setters for each field
/**
* Returns the unique identifier of the font
*
* @return the unique identifier of the font
*/
public UUID getId() {
return id;
}
/**
* Sets the unique identifier of the font
*
* @param id the unique identifier to set
*/
public void setId(UUID id) {
this.id = id;
}
public void setUiName(String uiName) {
this.uiName = uiName;
}
public String getUiName() {
return uiName;
}
public void setVariableName(String variableName) {
this.variableName = variableName;
}
public String getVariableName() {
return variableName;
}
public void setMapper(String mapper) {
this.mapper = mapper;
}
public String getMapper() {
return mapper;
}
public void setProvider(String provider) {
this.provider = provider;
}
public String getProvider() {
return provider;
}
public void setTexturePath(String texturePath) {
this.texturePath = texturePath;
}
public String getTexturePath() {
return texturePath;
}
public void setComment(String comment) {
this.comment = comment;
}
public String getComment() {
return comment;
}
/**
* Returns the ascent of the font
*
* @return the ascent of the font
*/
public int getAscent() {
return ascent;
}
/**
* Sets the ascent of the font
*
* @param ascent the ascent to set
*/
public void setAscent(int ascent) {
this.ascent = ascent;
}
/**
* Returns the height of the font
*
* @return the height of the font
*/
public int getHeight() {
return height;
}
/**
* Sets the height of the font
*
* @param height the height to set
*/
public void setHeight(int height) {
this.height = height;
}
/**
* Returns the list of characters included in the font
*
* @return the list of characters in the font
*/
public List<String> getChars() {
return chars;
}
/**
* Sets the list of characters included in the font
*
* @param chars the list of characters to set
*/
public void setChars(List<String> chars) {
this.chars = chars;
}
@Override
public String toString() {
return "FontEntity{" +
"id=" + id +
", uiName='" + uiName + '\'' +
", variableName='" + variableName + '\'' +
", provider='" + provider + '\'' +
", mapper='" + mapper + '\'' +
", texturePath='" + texturePath + '\'' +
", comment='" + comment + '\'' +
", height=" + height +
", ascent=" + ascent +
", chars=" + chars +
'}';
}
}