Skip to content

JSSD JssdEquals

AndreasWBartels edited this page Nov 22, 2016 · 3 revisions

Adding equals and hashCode method to data type

Definition

net/anwiba/generated/test/bean/spatialReference.jssd

@JssdEquals
{
"wkid" : <Integer> null,
"wkt" : <String> null
}

result

package net.anwiba.generated.test.bean;

import com.fasterxml.jackson.annotation.JsonProperty;
import net.anwiba.commons.lang.object.ObjectUtilities;

public class SpatialReference {

    private Integer wkid = null;
    private String wkt = null;

    @JsonProperty("wkid")
    public void setWkid(final Integer wkid) {
        this.wkid = wkid;
    }

    @JsonProperty("wkid")
    public Integer getWkid() {
        return this.wkid;
    }

    @JsonProperty("wkt")
    public void setWkt(final String wkt) {
        this.wkt = wkt;
    }

    @JsonProperty("wkt")
    public String getWkt() {
        return this.wkt;
    }

    @Override
    public boolean equals(Object object) {
        if (this == object) {
            return true;
        }
        if (!(object instanceof SpatialReference)) {
            return false;
        }
        SpatialReference other = ((SpatialReference) object);
        return (ObjectUtilities.equals(this.wkid, other.wkid)&&ObjectUtilities.equals(this.wkt, other.wkt));
    }

    @Override
    public int hashCode() {
        return ObjectUtilities.hashCode(this.wkid, this.wkt);
    }

}

Clone this wiki locally