File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
templates/cli/lib/type-generation/languages Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ import '<%- attribute.relatedCollection.toLowerCase() %>.dart';
52
52
<% if (attribute.format === ' enum' ) { -%>
53
53
enum <% - toPascalCase(attribute.key) %> {
54
54
<% for (const element of attribute.elements) { -%>
55
- <% - toPascalCase( element) %> ,
55
+ <% - element %> ,
56
56
<% } -%>
57
57
}
58
58
Original file line number Diff line number Diff line change @@ -9,8 +9,10 @@ class Java extends LanguageMeta {
9
9
case AttributeType.STRING:
10
10
case AttributeType.EMAIL:
11
11
case AttributeType.DATETIME:
12
- case AttributeType.ENUM:
13
12
type = "String";
13
+ if (attribute.format === AttributeType.ENUM) {
14
+ type = LanguageMeta.toPascalCase(attribute.key);
15
+ }
14
16
break;
15
17
case AttributeType.INTEGER:
16
18
type = "int";
@@ -47,6 +49,17 @@ import <%- toPascalCase(attribute.relatedCollection) %>;
47
49
<% } -%>
48
50
<% } -%>
49
51
public class <% - toPascalCase(collection.name) %> {
52
+ <% for (const attribute of collection.attributes) { -%>
53
+ <% if (attribute.format === ' enum' ) { -%>
54
+
55
+ public enum <% - toPascalCase(attribute.key) %> {
56
+ <% for (const [index, element] of Object .entries(attribute.elements)) { -%>
57
+ <% - element %><% - index < attribute.elements.length - 1 ? ' ,' : ' ;' %>
58
+ <% } -%>
59
+ }
60
+
61
+ <% } -%>
62
+ <% } -%>
50
63
<% for (const attribute of collection.attributes) { -%>
51
64
private <% - getType(attribute) %> <%= toCamelCase(attribute.key) %> ;
52
65
<% } -%>
You can’t perform that action at this time.
0 commit comments