
java.equals.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
{{&indent}} @Override
{{&indent}} public boolean equals(Object other) {
{{&indent}} if (this == other)
{{&indent}} return true;
{{&indent}} if (!(other instanceof {{&className}}))
{{&indent}} return false;
{{#hasBaseClassWithProperties}}{{&indent}} if (!super.equals(other))
{{&indent}} return false;
{{/hasBaseClassWithProperties}}{{#nonBaseProperties}}{{#first}}{{&indent}} {{&className}} typedOther = ({{&className}})other;
{{/first}}{{#last}}{{#isPrimitive}}{{&indent}} return {{&javaName}} == typedOther.{{&javaName}};
{{/isPrimitive}}{{^isPrimitive}}{{#isEnumClass}}{{&indent}} return {{&javaName}} == typedOther.{{&javaName}};
{{/isEnumClass}}{{^isEnumClass}}{{#nullable}}{{&indent}} return {{&javaName}} == null ? typedOther.{{&javaName}} == null : {{&javaName}}.equals(typedOther.{{&javaName}});
{{/nullable}}{{^nullable}}{{&indent}} return {{&javaName}}.equals(typedOther.{{&javaName}});
{{/nullable}}{{/isEnumClass}}{{/isPrimitive}}{{/last}}{{^last}}{{#isPrimitive}}{{&indent}} if ({{&javaName}} != typedOther.{{&javaName}})
{{/isPrimitive}}{{^isPrimitive}}{{#isEnumClass}}{{&indent}} if ({{&javaName}} != typedOther.{{&javaName}})
{{/isEnumClass}}{{^isEnumClass}}{{#nullable}}{{&indent}} if ({{&javaName}} == null ? typedOther.{{&javaName}} != null : !{{&javaName}}.equals(typedOther.{{&javaName}}))
{{/nullable}}{{^nullable}}{{&indent}} if (!{{&javaName}}.equals(typedOther.{{&javaName}}))
{{/nullable}}{{/isEnumClass}}{{/isPrimitive}}{{&indent}} return false;
{{/last}}{{/nonBaseProperties}}{{^nonBaseProperties}}{{&indent}} return true;
{{/nonBaseProperties}}{{&indent}} }
© 2015 - 2025 Weber Informatics LLC | Privacy Policy