All Downloads are FREE. Search and download functionalities are using the official Maven repository.

java.equals.mustache Maven / Gradle / Ivy

There is a newer version: 0.118
Show newest version
{{&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