Skip to content

Commit faa0899

Browse files
Improve variable declaration to improve usability (#22)
1 parent 78ec95e commit faa0899

3 files changed

Lines changed: 95 additions & 96 deletions

File tree

src/main/java/net/onelitefeather/vulpes/api/model/AttributeEntity.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ public class AttributeEntity implements VulpesModel {
2424
@GeneratedValue(strategy = GenerationType.UUID)
2525
@VulpesGenerator
2626
private UUID id;
27-
private String modelName;
28-
private String name;
27+
private String uiName;
28+
private String variableName;
2929
private double defaultValue;
3030
private double maximumValue;
3131

@@ -43,15 +43,15 @@ public AttributeEntity() {
4343
* Constructs a new {@link AttributeEntity} with the specified values.
4444
*
4545
* @param id the unique identifier of the attribute
46-
* @param modelName the model name associated with the attribute
47-
* @param name the name of the attribute
46+
* @param uiName the model name associated with the attribute
47+
* @param variableName the name of the attribute
4848
* @param defaultValue the default value of the attribute
4949
* @param maximumValue the maximum value of the attribute
5050
*/
51-
public AttributeEntity(UUID id, String modelName, String name, double defaultValue, double maximumValue) {
51+
public AttributeEntity(UUID id, String uiName, String variableName, double defaultValue, double maximumValue) {
5252
this.id = id;
53-
this.modelName = modelName;
54-
this.name = name;
53+
this.uiName = uiName;
54+
this.variableName = variableName;
5555
this.defaultValue = defaultValue;
5656
this.maximumValue = maximumValue;
5757
}
@@ -81,35 +81,35 @@ public void setId(UUID id) {
8181
*
8282
* @return the model name of the attribute
8383
*/
84-
public String getModelName() {
85-
return modelName;
84+
public String getUiName() {
85+
return uiName;
8686
}
8787

8888
/**
8989
* Sets the model name associated with the attribute
9090
*
9191
* @param modelName the model name to set
9292
*/
93-
public void setModelName(String modelName) {
94-
this.modelName = modelName;
93+
public void setUiName(String modelName) {
94+
this.uiName = modelName;
9595
}
9696

9797
/**
9898
* Returns the name of the attribute
9999
*
100100
* @return the name of the attribute
101101
*/
102-
public String getName() {
103-
return name;
102+
public String getVariableName() {
103+
return variableName;
104104
}
105105

106106
/**
107107
* Sets the name of the attribute
108108
*
109109
* @param name the name to set
110110
*/
111-
public void setName(String name) {
112-
this.name = name;
111+
public void setVariableName(String name) {
112+
this.variableName = name;
113113
}
114114

115115
/**
@@ -157,8 +157,8 @@ public void setMaximumValue(double maximumValue) {
157157
public String toString() {
158158
return "AttributeModel{" +
159159
"id='" + id + '\'' +
160-
", modelName='" + modelName + '\'' +
161-
", name='" + name + '\'' +
160+
", modelName='" + uiName + '\'' +
161+
", name='" + variableName + '\'' +
162162
", defaultValue=" + defaultValue +
163163
", maximumValue=" + maximumValue +
164164
'}';

src/main/java/net/onelitefeather/vulpes/api/model/ItemEntity.java

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ public class ItemEntity implements VulpesModel {
2828
@VulpesGenerator
2929
private UUID id;
3030

31-
private String modelName;
32-
private String name;
33-
private String description;
31+
private String uiName;
32+
private String variableName;
33+
private String comment;
3434
private String displayName;
3535
private String material;
3636
private String groupName;
@@ -57,23 +57,23 @@ public ItemEntity() {
5757
* Constructs a new {@link ItemEntity} with the specified values.
5858
*
5959
* @param id the unique identifier of the item
60-
* @param modelName the model name associated with the item
61-
* @param name the name of the item
62-
* @param description a description of the item
60+
* @param uiName the model name associated with the item
61+
* @param variableName the name of the item
62+
* @param comment a description of the item
6363
* @param displayName the display name of the item
6464
* @param material the material type associated with the item
65-
* @param groupName the group to which the item belongs
65+
* @param groupName the group to which the item belongs
6666
* @param customModelData the custom model data for the item
6767
* @param amount the amount of the item
6868
* @param enchantments the enchantments applied to the item
6969
* @param lore the lore associated with the item
7070
* @param flags the flags associated with the item
7171
*/
72-
public ItemEntity(UUID id, String modelName, String name, String description, String displayName, String material, String groupName, int customModelData, int amount, Map<String, Short> enchantments, List<String> lore, List<String> flags) {
72+
public ItemEntity(UUID id, String uiName, String variableName, String comment, String displayName, String material, String groupName, int customModelData, int amount, Map<String, Short> enchantments, List<String> lore, List<String> flags) {
7373
this.id = id;
74-
this.modelName = modelName;
75-
this.name = name;
76-
this.description = description;
74+
this.uiName = uiName;
75+
this.variableName = variableName;
76+
this.comment = comment;
7777
this.displayName = displayName;
7878
this.material = material;
7979
this.groupName = groupName;
@@ -105,59 +105,60 @@ public void setId(UUID id) {
105105
}
106106

107107
/**
108-
* Returns the model name associated with the item.
108+
* Sets the name representation for the ui
109109
*
110-
* @return the model name of the item
110+
* @param uiName the name to set for the ui
111111
*/
112-
public String getModelName() {
113-
return modelName;
112+
public void setUiName(String uiName) {
113+
this.uiName = uiName;
114114
}
115115

116116
/**
117-
* Sets the model name associated with the item.
117+
* Returns the name representation for the ui
118118
*
119-
* @param modelName the model name to set
119+
* @return the given ui name
120120
*/
121-
public void setModelName(String modelName) {
122-
this.modelName = modelName;
121+
public String getUiName() {
122+
return uiName;
123123
}
124124

125125
/**
126-
* Returns the name of the item.
126+
* Sets the variable name for the notification
127127
*
128-
* @return the name of the item
128+
* @param variableName the variable name to set
129129
*/
130-
public String getName() {
131-
return name;
130+
public void setVariableName(String variableName) {
131+
this.variableName = variableName;
132132
}
133133

134134
/**
135-
* Sets the name of the item.
135+
* Returns the variable name for the notification
136136
*
137-
* @param name the name to set
137+
* @return the variable name of the notification
138138
*/
139-
public void setName(String name) {
140-
this.name = name;
139+
public String getVariableName() {
140+
return variableName;
141141
}
142142

143143
/**
144-
* Returns the description of the item.
144+
* Returns the comment of the notification
145145
*
146-
* @return the description of the item
146+
* @return the description
147147
*/
148-
public String getDescription() {
149-
return description;
148+
public String getComment() {
149+
return comment;
150150
}
151151

152152
/**
153-
* Sets the description of the item.
153+
* Sets the comment of the notification
154154
*
155-
* @param description the description to set
155+
* @param description the comment to set
156156
*/
157-
public void setDescription(String description) {
158-
this.description = description;
157+
public void setComment(String description) {
158+
this.comment = description;
159159
}
160160

161+
161162
/**
162163
* Returns the display name of the item.
163164
*
@@ -311,9 +312,9 @@ public void setFlags(List<String> flags) {
311312
public String toString() {
312313
return "ItemModel{" +
313314
"id='" + id + '\'' +
314-
", modelName='" + modelName + '\'' +
315-
", name='" + name + '\'' +
316-
", description='" + description + '\'' +
315+
", modelName='" + uiName + '\'' +
316+
", name='" + variableName + '\'' +
317+
", comment='" + comment + '\'' +
317318
", displayName='" + displayName + '\'' +
318319
", material='" + material + '\'' +
319320
", group='" + groupName + '\'' +

src/main/java/net/onelitefeather/vulpes/api/model/NotificationEntity.java

Lines changed: 39 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ public class NotificationEntity implements VulpesModel {
2424
@GeneratedValue(strategy = GenerationType.UUID)
2525
@VulpesGenerator
2626
private UUID id;
27-
private String modelName;
28-
private String name;
29-
private String description;
27+
private String uiName;
28+
private String variableName;
29+
private String comment;
3030
private String material;
3131
private String frameType;
3232
private String title;
@@ -44,19 +44,17 @@ public NotificationEntity() {
4444
/**
4545
* Constructs a new {@link NotificationEntity} with the specified values.
4646
*
47-
* @param id the unique identifier of the notification
48-
* @param modelName the model name associated with the notification
49-
* @param name the name of the notification
50-
* @param description a description of the notification
51-
* @param material the material type associated with the notification
52-
* @param frameType the frame type associated with the notification
53-
* @param title the title of the notification
47+
* @param id the unique identifier of the notification
48+
* @param comment a comment for the description
49+
* @param material the material type associated with the notification
50+
* @param frameType the frame type associated with the notification
51+
* @param title the title of the notification
5452
*/
55-
public NotificationEntity(UUID id, String modelName, String name, String description, String material, String frameType, String title) {
53+
public NotificationEntity(UUID id, String uiName, String variableName, String comment, String material, String frameType, String title) {
5654
this.id = id;
57-
this.modelName = modelName;
58-
this.name = name;
59-
this.description = description;
55+
this.uiName = uiName;
56+
this.variableName = variableName;
57+
this.comment = comment;
6058
this.material = material;
6159
this.frameType = frameType;
6260
this.title = title;
@@ -81,57 +79,57 @@ public void setId(UUID id) {
8179
}
8280

8381
/**
84-
* Returns the model name associated with the notification
82+
* Sets the name representation for the ui
8583
*
86-
* @return the model name of the notification
84+
* @param uiName the name to set for the ui
8785
*/
88-
public String getModelName() {
89-
return modelName;
86+
public void setUiName(String uiName) {
87+
this.uiName = uiName;
9088
}
9189

9290
/**
93-
* Sets the model name associated with the notification
91+
* Returns the name representation for the ui
9492
*
95-
* @param modelName the model name to set
93+
* @return the given ui name
9694
*/
97-
public void setModelName(String modelName) {
98-
this.modelName = modelName;
95+
public String getUiName() {
96+
return uiName;
9997
}
10098

10199
/**
102-
* Returns the name of the notification
100+
* Sets the variable name for the notification
103101
*
104-
* @return the name of the notification
102+
* @param variableName the variable name to set
105103
*/
106-
public String getName() {
107-
return name;
104+
public void setVariableName(String variableName) {
105+
this.variableName = variableName;
108106
}
109107

110108
/**
111-
* Sets the name of the notification
109+
* Returns the variable name for the notification
112110
*
113-
* @param name the name to set
111+
* @return the variable name of the notification
114112
*/
115-
public void setName(String name) {
116-
this.name = name;
113+
public String getVariableName() {
114+
return variableName;
117115
}
118116

119117
/**
120-
* Returns the description of the notification
118+
* Returns the comment of the notification
121119
*
122-
* @return the description of the notification
120+
* @return the description
123121
*/
124-
public String getDescription() {
125-
return description;
122+
public String getComment() {
123+
return comment;
126124
}
127125

128126
/**
129-
* Sets the description of the notification
127+
* Sets the comment of the notification
130128
*
131-
* @param description the description to set
129+
* @param description the comment to set
132130
*/
133-
public void setDescription(String description) {
134-
this.description = description;
131+
public void setComment(String description) {
132+
this.comment = description;
135133
}
136134

137135
/**
@@ -197,9 +195,9 @@ public void setTitle(String title) {
197195
public String toString() {
198196
return "NotificationModel{" +
199197
"id='" + id + '\'' +
200-
", modelName='" + modelName + '\'' +
201-
", name='" + name + '\'' +
202-
", description='" + description + '\'' +
198+
", uiName='" + uiName + '\'' +
199+
", variableName='" + variableName + '\'' +
200+
", description='" + comment + '\'' +
203201
", material='" + material + '\'' +
204202
", frameType='" + frameType + '\'' +
205203
", title='" + title + '\'' +

0 commit comments

Comments
 (0)