Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ $ `cd translator && ./run/run-java --file=../test/test-dir/entities.yml --out=..

Updating the version in all files:

$ `./util/update-vesion 1.0.1 1.1.0`
$ `./util/update-version 1.0.1 1.1.0`
16 changes: 16 additions & 0 deletions translator/src/genKotlin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,18 @@ fun genKotlinFieldDefault(type: String): String {
if (type == "Bool") {
return "false"
}
// `Double` -> `0`
if (type == "Double") {
return "0"
}
// `Int` -> `0`
if (type == "Int") {
return "0"
}
// `Long` -> `0`
if (type == "Long") {
return "0"
}
// `String` -> `""`
if (type == "String") {
return "\"\""
Expand Down Expand Up @@ -148,6 +156,14 @@ fun genKotlinFieldType(type: String): String {
if (type == "Bool") {
return "Boolean"
}
// `Double` -> `Double`
if (type == "Double") {
return "Double"
}
// `Long` -> `Long`
if (type == "Long") {
return "Long"
}
// `[Type]` -> `Array<Type>`
if (
type.startsWith("[") &&
Expand Down