Example usage for java.util Objects equals

List of usage examples for java.util Objects equals

Introduction

In this page you can find the example usage for java.util Objects equals.

Prototype

public static boolean equals(Object a, Object b) 

Source Link

Document

Returns true if the arguments are equal to each other and false otherwise.

Usage

From source file:br.com.alura.casadocodigo.models.CarrinhoCompras.java

@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }/*from w  w  w .ja  v  a2  s.c o  m*/
    if (obj == null) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final CarrinhoCompras other = (CarrinhoCompras) obj;
    if (!Objects.equals(this.itens, other.itens)) {
        return false;
    }
    return true;
}

From source file:xyz.cloudbans.entities.events.PlayerNoticeEvent.java

@Override
public boolean equals(Object o) {
    if (this == o)
        return true;
    if (!(o instanceof PlayerNoticeEvent))
        return false;
    PlayerNoticeEvent that = (PlayerNoticeEvent) o;
    return Objects.equals(getNotice(), that.getNotice()) && getAction() == that.getAction();
}

From source file:domen.Korisnik.java

@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }//from ww  w  . j a  v  a2 s  .  com
    if (obj == null) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final Korisnik other = (Korisnik) obj;
    if (!Objects.equals(this.korisnickoIme, other.korisnickoIme)) {
        return false;
    }
    if (!Objects.equals(this.password, other.password)) {
        return false;
    }
    return true;
}

From source file:com.joyent.manta.client.multipart.AbstractMultipartUpload.java

@Override
public boolean equals(final Object o) {
    if (this == o) {
        return true;
    }/*from   w  w w  .  j  a v a  2s  . c  o  m*/

    if (o == null || getClass() != o.getClass()) {
        return false;
    }

    final MantaMultipartUpload that = (MantaMultipartUpload) o;

    return Objects.equals(id, that.getId()) && Objects.equals(path, that.getPath());
}

From source file:technology.tikal.customers.model.name.OrganizationName.java

@Override
public boolean equals(Object obj) {
    if (obj == this) {
        return true;
    }/*ww  w  . ja va 2 s  .  c  om*/
    if (obj instanceof OrganizationName) {
        OrganizationName other = (OrganizationName) obj;
        return Objects.equals(name, other.name) && Objects.equals(name, other.name);
    }
    return false;
}

From source file:be.bittich.quote.vo.SecurityToken.java

@Override
public boolean equals(Object obj) {
    if (Objects.isNull(obj) || !(obj instanceof SecurityToken)) {
        return false;
    }//from  w w w.j a  va 2  s . com
    SecurityToken tk = (SecurityToken) obj;
    return (Objects.equals(this.getKey(), tk.getKey())
            && Objects.equals(this.getExtendedInformation(), tk.getExtendedInformation())
            && Objects.equals(this.getKeyCreationTime(), this.getKeyCreationTime()));
}

From source file:com.vsct.dt.strowgr.admin.nsq.payload.RegisterServer.java

@Override
public boolean equals(Object o) {
    if (this == o)
        return true;
    if (o == null || getClass() != o.getClass())
        return false;
    RegisterServer that = (RegisterServer) o;
    return Objects.equals(header, that.header) && Objects.equals(server, that.server);
}

From source file:com.sample.eventmanager.dto.JsonFormat.java

@Override
public boolean equals(Object obj) {
    if (obj == null) {
        return false;
    }//from   w  w w.java2  s.c o  m
    if (getClass() != obj.getClass()) {
        return false;
    }
    final JsonFormat<?> other = (JsonFormat<?>) obj;
    if (!Objects.equals(this.status, other.status)) {
        return false;
    }
    if (!Objects.equals(this.message, other.message)) {
        return false;
    }
    if (!Objects.equals(this.data, other.data)) {
        return false;
    }
    return true;
}

From source file:com.thoughtworks.go.api.ControllerMethods.java

default boolean fresh(Request req, String etagFromServer) {
    String etagFromClient = getIfNoneMatch(req);
    if (etagFromClient == null) {
        return false;
    }// w w  w.  j ava  2  s. co  m
    return Objects.equals(etagFromClient, etagFromServer);
}

From source file:com.cloud.agent.api.manager.SupportedApiVersionCommand.java

@Override
public boolean equals(Object o) {
    if (this == o) {
        return true;
    }/*from ww  w .  j  a v a  2s. co m*/

    if (!(o instanceof SupportedApiVersionCommand)) {
        return false;
    }

    SupportedApiVersionCommand that = (SupportedApiVersionCommand) o;

    return super.equals(that) && Objects.equals(_apiVersion, that._apiVersion);

}