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:local.laer.app.knapsack.domain.ImmutablePosition.java

@Override
public boolean equals(Object obj) {
    if (obj == this || obj == null) {
        return obj == this;
    }// ww  w.j a va2s . c o  m

    if (!Objects.equals(getClass(), obj.getClass())) {
        return false;
    }

    ImmutablePosition other = getClass().cast(obj);

    return col == other.col && row == other.row;
}

From source file:com.ezsource_mobile.rfxdb.models.query.UpdateMobileRegnIdRequest.java

@Override
public boolean equals(Object o) {
    if (this == o)
        return true;
    if (!(o instanceof UpdateMobileRegnIdRequest))
        return false;
    final UpdateMobileRegnIdRequest updateMobileRegnIdRequest = (UpdateMobileRegnIdRequest) o;
    return Objects.equals(getMobileRegnId(), updateMobileRegnIdRequest.getMobileRegnId());
}

From source file:uk.ac.ebi.ep.ebeye.autocomplete.Suggestion.java

@Override
public boolean equals(Object obj) {
    if (obj == null) {
        return false;
    }/*from  w ww . j av  a 2 s  .c  om*/
    if (getClass() != obj.getClass()) {
        return false;
    }
    final Suggestion other = (Suggestion) obj;
    return Objects.equals(this.suggestedKeyword, other.suggestedKeyword);
}

From source file:com.qwazr.externalizor.AbstractProperty.java

@Override
public boolean equals(Object o) {
    if (o == null || !(o instanceof AbstractProperty))
        return false;
    AbstractProperty p = (AbstractProperty) o;
    if (!Objects.equals(test, p.test))
        return false;
    if (!Objects.equals(pair, p.pair))
        return false;
    return true;/*from w w  w.  ja  v a  2s .co  m*/
}

From source file:com.inkubator.hrm.web.converter.CompanyConverter.java

@Override
public String getAsString(FacesContext context, UIComponent component, Object value) {

    ResourceBundle resourceBundle = ResourceBundle.getBundle("Messages",
            new Locale(FacesUtil.getSessionAttribute(HRMConstant.BAHASA_ACTIVE).toString()));

    String message = StringUtils.EMPTY;
    String data = (String) value;
    if (Objects.equals(data, HRMConstant.ORGANIZATION_LEVEL_HOLDING)) {
        message = resourceBundle.getString("organization.holding");
    } else if (Objects.equals(data, HRMConstant.ORGANIZATION_LEVEL_COMPANY)) {
        message = resourceBundle.getString("organization.company");
    }/*from ww w  .  j ava  2 s.  co  m*/

    return message;
}

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

@Override
public boolean equals(Object o) {
    return this == o
            || (o instanceof PlayerKickEvent && Objects.equals(getKick(), ((PlayerKickEvent) o).getKick()));
}

From source file:com.intel.podm.client.RetryInvoker.java

private static boolean maximumAttemptsReached(Integer currentAttemptNumber) {
    checkNotNull(currentAttemptNumber);// ww  w .j  av  a  2  s.  c om
    return Objects.equals(MAX_RETRY_ATTEMPTS, currentAttemptNumber);
}

From source file:com.linksinnovation.elearning.model.Authority.java

@Override
public boolean equals(Object obj) {
    if (obj == null) {
        return false;
    }//from   w w  w.ja  va 2  s.c  o  m
    if (getClass() != obj.getClass()) {
        return false;
    }
    final Authority other = (Authority) obj;
    if (!Objects.equals(this.authority, other.authority)) {
        return false;
    }
    return true;
}

From source file:com.mycompany.wolf.Router.java

public void register(Session session) {
    ServerInfo server = servers.stream()
            .filter(s -> Objects.equals(s.getIntranetAddress(), remoteAddress(session))).findAny().orElse(null);
    if (server != null) {
        server.setCurrentSession(session);
    }/*from   w  w  w .  ja  v a2  s. c  om*/
}

From source file:com.inkubator.hrm.web.converter.OvertimeImplCalculationMethodConverter.java

@Override
public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object value) {
    ResourceBundle resourceBundle = ResourceBundle.getBundle("Messages",
            new Locale(FacesUtil.getSessionAttribute(HRMConstant.BAHASA_ACTIVE).toString()));
    String messages = StringUtils.EMPTY;
    Integer data = (Integer) value;
    if (Objects.equals(data, HRMConstant.OVERTIME_CALCULATION_STATIC)) {
        messages = resourceBundle.getString("overTimeImplementation.static");
    } else if (Objects.equals(data, HRMConstant.OVERTIME_CALCULATION_RELATIVE)) {
        messages = resourceBundle.getString("overTimeImplementation.relative");
    }/*from www  . j a v  a 2  s .c om*/
    return messages;

}