![JAR search and dependency download from the Maven repository](/logo.png)
templates.kotlin.open_class.mustache Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of json-kotlin-schema-codegen Show documentation
Show all versions of json-kotlin-schema-codegen Show documentation
Code generation from JSON Schema to Kotlin or Java
{{>header}}{{#packageName}}package {{&packageName}}
{{/packageName}}{{#constraints}}{{>system_imports}}{{#imports}}import {{&.}}
{{#last}}
{{/last}}{{/imports}}{{#schema}}{{#description}}/**
* {{&description}}
*/
{{/description}}{{/schema}}open class {{&className}}(
{{#baseClass}}{{#constraints}}{{#properties}}{{#schema}}{{#description}} /** {{&safeDescription}} */
{{/description}}{{/schema}} {{&kotlinName}}: {{>type}}{{^isRequired}} = {{!
}}{{#defaultValue}}{{>default_value}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/isRequired}},
{{/properties}}{{/constraints}}{{/baseClass}}{{#nonBaseProperties}}{{#schema}}{{#description}} /** {{&safeDescription}} */
{{/description}}{{/schema}} val {{&kotlinName}}: {{>type}}{{^isRequired}} = {{!
}}{{#defaultValue}}{{>default_value}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/isRequired}}{{^last}},{{/last}}
{{/nonBaseProperties}}){{#baseClass}} : {{&className}}({{#constraints}}{{#properties}}{{&kotlinName}}{{^last}}, {{/last}}{{/properties}}{{/constraints}}){{!
}}{{#interfaces}}, {{&className}}{{/interfaces}}{{/baseClass}}{{!
}}{{^baseClass}}{{#interfaces}}{{#first}} :{{/first}}{{^first}},{{/first}} {{&className}}{{/interfaces}}{{/baseClass}} {
{{#validationsPresent}}
init {
{{#properties}}{{>validations}}{{/properties}} }
{{/validationsPresent}}
{{>equals}}
{{>hashcode}}
{{#nestedClasses}}
{{#constraints}}{{>nested_class}}{{/constraints}}{{/nestedClasses}}{{>add_statics}}
}{{/constraints}}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy