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:com.jbuncle.mysqlsynchroniser.structure.objects.Table.java

@Override
public boolean equals(Object obj) {
    if (!(obj instanceof Table)) {
        return false;
    }/*w w  w.j  a v a 2 s  .c  om*/
    final Table other = (Table) obj;
    if (!Objects.equals(this.tableName, other.tableName)) {
        return false;
    }
    if (!CollectionUtils.isEqualCollection(this.columns, other.columns)) {
        return false;
    }
    return CollectionUtils.isEqualCollection(this.indexes, other.indexes);
}

From source file:edu.berkeley.ground.common.model.version.Tag.java

@Override
public boolean equals(Object other) {
    if (!(other instanceof Tag)) {
        return false;
    }/*  w  ww .  j  a  va 2 s.  c  om*/

    Tag otherTag = (Tag) other;

    return this.key.equals(otherTag.key) && Objects.equals(this.value, otherTag.value)
            && Objects.equals(this.valueType, otherTag.valueType);
}

From source file:com.autodesk.client.model.CreateBucket.java

@Override
public boolean equals(java.lang.Object o) {
    if (this == o) {
        return true;
    }/*from w  w w .ja v  a2  s .c o m*/
    if (o == null || getClass() != o.getClass()) {
        return false;
    }
    CreateBucket createBucket = (CreateBucket) o;
    return Objects.equals(this.bucketKey, createBucket.bucketKey)
            && Objects.equals(this.policyKey, createBucket.policyKey);
}

From source file:io.dockstore.webservice.core.WorkflowVersion.java

@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }//w ww  .  j a va2 s  .  c  om
    if (obj == null || getClass() != obj.getClass()) {
        return false;
    }
    if (!super.equals(obj)) {
        return false;
    }
    final WorkflowVersion other = (WorkflowVersion) obj;
    return Objects.equals(this.workflowPath, other.workflowPath);
}

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

@Override
public boolean equals(Object obj) {
    if (obj == this) {
        return true;
    }/*from ww w.  ja v  a2 s  .  co m*/
    if (obj instanceof NombrePersonaMx) {
        NombrePersonaMx other = (NombrePersonaMx) obj;
        return Objects.equals(primerNombre, other.primerNombre)
                && Objects.equals(segundoNombre, other.segundoNombre)
                && Objects.equals(apellidoPaterno, other.apellidoPaterno)
                && Objects.equals(apellidoMaterno, other.apellidoMaterno);
    }
    return false;
}

From source file:edu.temple.cis3238.wiki.vo.TopicVO.java

@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }/*  w ww .  ja va2s .c  o  m*/
    if (obj == null) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final TopicVO other = (TopicVO) obj;
    if (this.topicID != other.topicID) {
        return false;
    }
    if (!Objects.equals(this.getTopicContent(), other.getTopicContent())) {
        return false;
    }
    if (!Objects.equals(this.getTopicName(), other.getTopicName())) {
        return false;
    }
    return true;
}

From source file:com.autodesk.client.model.BucketObjects.java

@Override
public boolean equals(java.lang.Object o) {
    if (this == o) {
        return true;
    }/* w w w .  java  2  s  . c  o  m*/
    if (o == null || getClass() != o.getClass()) {
        return false;
    }
    BucketObjects bucketObjects = (BucketObjects) o;
    return Objects.equals(this.items, bucketObjects.items) && Objects.equals(this.next, bucketObjects.next);
}

From source file:com.haulmont.cuba.web.sys.CubaUIProvider.java

protected String getCookieValue(Cookie[] cookies, String key) {
    if (cookies == null || key == null) {
        return null;
    }//from  w  w  w  . ja  v  a 2  s. co m
    for (final Cookie cookie : cookies) {
        if (Objects.equals(cookie.getName(), key)) {
            return cookie.getValue();
        }
    }
    return null;
}

From source file:fi.hsl.parkandride.dev.DevHelper.java

@TransactionalWrite
public User createOrUpdateUser(NewUser newUser) {
    UserSecret userSecret;/*from  w ww.j ava  2 s.co m*/
    try {
        userSecret = userRepository.getUser(newUser.username);
        if (newUser.operatorId != null && !Objects.equals(newUser.operatorId, userSecret.user.operatorId)) {
            throw new IllegalArgumentException(
                    "Tried to create user '" + newUser.username + "' with operatorId " + newUser.operatorId
                            + ", but there already was a user with same name and operatorId "
                            + userSecret.user.operatorId + " and we can't change the operatorId afterwards");
        }
        if (newUser.role != userSecret.user.role) {
            userRepository.updateUser(userSecret.user.id, newUser);
        }
        if (newUser.password != null) {
            userRepository.updatePassword(userSecret.user.id,
                    authenticationService.encryptPassword(newUser.password));
        }
    } catch (NotFoundException e) {
        userSecret = new UserSecret();
        userSecret.user = userService.createUserNoValidate(newUser);
    }
    return userSecret.user;
}

From source file:com.jivesoftware.os.upena.amza.shared.TableName.java

@Override
public boolean equals(Object obj) {
    if (obj == null) {
        return false;
    }/*  w  ww  .  j  a  v  a2s.c o m*/
    if (getClass() != obj.getClass()) {
        return false;
    }
    final TableName other = (TableName) obj;
    if (!Objects.equals(this.ringName, other.ringName)) {
        return false;
    }
    if (!Objects.equals(this.tableName, other.tableName)) {
        return false;
    }
    if (!Objects.equals(this.minKeyInclusive, other.minKeyInclusive)) {
        return false;
    }
    if (!Objects.equals(this.maxKeyExclusive, other.maxKeyExclusive)) {
        return false;
    }
    return true;
}