Skip to content

Commit aa82365

Browse files
committed
Adapt to Case class changes
1 parent 05ed43b commit aa82365

File tree

6 files changed

+23
-20
lines changed

6 files changed

+23
-20
lines changed

vertx-sql-client-templates/src/main/asciidoc/index.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,8 @@ You can also configure a specific formatting case of a mapper in the `RowMapped`
331331

332332
The following cases can be used:
333333

334-
- {@link io.vertx.codegen.CamelCase} : `FirstName`
335-
- {@link io.vertx.codegen.LowerCamelCase} : `firstName` - like camel case but starts with a lower case, this is the default case
336-
- {@link io.vertx.codegen.SnakeCase} : `first_name`
337-
- {@link io.vertx.codegen.KebabCase} : `first-name`
338-
- {@link io.vertx.codegen.QualifiedCase} : `first.name`
334+
- {@link io.vertx.codegen.format.CamelCase} : `FirstName`
335+
- {@link io.vertx.codegen.format.LowerCamelCase} : `firstName` - like camel case but starts with a lower case, this is the default case
336+
- {@link io.vertx.codegen.format.SnakeCase} : `first_name`
337+
- {@link io.vertx.codegen.format.KebabCase} : `first-name`
338+
- {@link io.vertx.codegen.format.QualifiedCase} : `first.name`

vertx-sql-client-templates/src/main/java/examples/TemplateExamples.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package examples;
22

3-
import io.vertx.codegen.QualifiedCase;
4-
import io.vertx.codegen.SnakeCase;
3+
import io.vertx.codegen.format.QualifiedCase;
4+
import io.vertx.codegen.format.SnakeCase;
55
import io.vertx.codegen.annotations.DataObject;
66
import io.vertx.docgen.Source;
77
import io.vertx.sqlclient.Row;

vertx-sql-client-templates/src/main/java/io/vertx/sqlclient/templates/annotations/ParametersMapped.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package io.vertx.sqlclient.templates.annotations;
22

3-
import io.vertx.codegen.Case;
4-
import io.vertx.codegen.LowerCamelCase;
3+
import io.vertx.codegen.format.Case;
4+
import io.vertx.codegen.format.LowerCamelCase;
55

66
import java.lang.annotation.ElementType;
77
import java.lang.annotation.Retention;

vertx-sql-client-templates/src/main/java/io/vertx/sqlclient/templates/annotations/RowMapped.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package io.vertx.sqlclient.templates.annotations;
22

3-
import io.vertx.codegen.Case;
4-
import io.vertx.codegen.LowerCamelCase;
3+
import io.vertx.codegen.format.Case;
4+
import io.vertx.codegen.format.LowerCamelCase;
55

66
import java.lang.annotation.ElementType;
77
import java.lang.annotation.Retention;

vertx-sql-client-templates/src/main/java/io/vertx/sqlclient/templates/generator/MapperGenBase.java

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
package io.vertx.sqlclient.templates.generator;
22

3-
import io.vertx.codegen.Case;
3+
import io.vertx.codegen.format.CamelCase;
4+
import io.vertx.codegen.format.Case;
45
import io.vertx.codegen.DataObjectModel;
56
import io.vertx.codegen.Generator;
67
import io.vertx.codegen.PropertyInfo;
78
import io.vertx.codegen.PropertyKind;
89
import io.vertx.codegen.annotations.DataObject;
10+
import io.vertx.codegen.format.LowerCamelCase;
11+
import io.vertx.codegen.format.SnakeCase;
912
import io.vertx.codegen.type.AnnotationValueInfo;
1013
import io.vertx.codegen.type.ClassTypeInfo;
1114

@@ -51,12 +54,12 @@ private Case getCase(DataObjectModel model, String name) {
5154
AnnotationValueInfo abc = getAnnotation(model).get();
5255
ClassTypeInfo cti = (ClassTypeInfo) abc.getMember(name);
5356
switch (cti.getName()) {
54-
case "io.vertx.codegen.CamelCase":
55-
return Case.CAMEL;
56-
case "io.vertx.codegen.SnakeCase":
57-
return Case.SNAKE;
58-
case "io.vertx.codegen.LowerCamelCase":
59-
return Case.LOWER_CAMEL;
57+
case "io.vertx.codegen.format.CamelCase":
58+
return CamelCase.INSTANCE;
59+
case "io.vertx.codegen.format.SnakeCase":
60+
return SnakeCase.INSTANCE;
61+
case "io.vertx.codegen.format.LowerCamelCase":
62+
return LowerCamelCase.INSTANCE;
6063
default:
6164
throw new UnsupportedOperationException();
6265
}
@@ -99,6 +102,6 @@ protected String getMappingName(PropertyInfo prop, String annotationName) {
99102
}
100103
}
101104
String name = Character.toUpperCase(prop.getName().charAt(0)) + prop.getName().substring(1);
102-
return Case.CAMEL.to(formatter, name);
105+
return CamelCase.INSTANCE.to(formatter, name);
103106
}
104107
}

vertx-sql-client-templates/src/test/java/io/vertx/sqlclient/templates/UserDataObject.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package io.vertx.sqlclient.templates;
22

3-
import io.vertx.codegen.SnakeCase;
3+
import io.vertx.codegen.format.SnakeCase;
44
import io.vertx.codegen.annotations.DataObject;
55
import io.vertx.sqlclient.templates.annotations.Column;
66
import io.vertx.sqlclient.templates.annotations.RowMapped;

0 commit comments

Comments
 (0)