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

org.visallo.web.clientapi.model.DirectoryPerson Maven / Gradle / Ivy

There is a newer version: 4.0.0
Show newest version
package org.visallo.web.clientapi.model;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;

@JsonTypeName(DirectoryEntity.TYPE_PERSON)
public class DirectoryPerson extends DirectoryEntity {
    private final String email;

    @JsonCreator
    public DirectoryPerson(
            @JsonProperty("id") String id,
            @JsonProperty("displayName") String displayName
    ) {
        this(id, displayName, null);
    }

    @JsonCreator
    public DirectoryPerson(
            @JsonProperty("id") String id,
            @JsonProperty("displayName") String displayName,
            @JsonProperty("email") String email
    ) {
        super(id, displayName);
        this.email = email;
    }

    @Override
    public String getType() {
        return TYPE_PERSON;
    }

    public String getEmail() {
        return email;
    }

    @Override
    public boolean equals(Object o) {
        if (!(o instanceof DirectoryPerson)) {
            return false;
        }
        DirectoryPerson other = (DirectoryPerson)o;
        return super.equals(other) && email.equals(other.email);
    }

    @Override
    public int hashCode() {
        return super.hashCode() + 31 * email.hashCode();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy