Example usage for org.springframework.util ObjectUtils nullSafeEquals

List of usage examples for org.springframework.util ObjectUtils nullSafeEquals

Introduction

In this page you can find the example usage for org.springframework.util ObjectUtils nullSafeEquals.

Prototype

public static boolean nullSafeEquals(@Nullable Object o1, @Nullable Object o2) 

Source Link

Document

Determine if the given objects are equal, returning true if both are null or false if only one is null .

Usage

From source file:com.springsource.hq.plugin.tcserver.serverconfig.configuration.jvm.GarbageCollection.java

@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }/*w  ww  .j ava2  s  .c o m*/
    if (!(obj instanceof GarbageCollection)) {
        return false;
    }
    GarbageCollection garbageCollection = (GarbageCollection) obj;
    return ObjectUtils.nullSafeEquals(this.getMaxGCMinorPauseMillis(),
            garbageCollection.getMaxGCMinorPauseMillis())
            && ObjectUtils.nullSafeEquals(this.getMaxGCPauseMillis(), garbageCollection.getMaxGCPauseMillis());
}

From source file:com.springsource.hq.plugin.tcserver.serverconfig.configuration.general.ServerProperties.java

@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }/*from w w  w  .  j a va2s .  c om*/
    if (!(obj instanceof ServerProperties)) {
        return false;
    }
    ServerProperties serverProperties = (ServerProperties) obj;
    return ObjectUtils.nullSafeEquals(this.getPort(), serverProperties.getPort())
            && ObjectUtils.nullSafeEquals(this.getShutdown(), serverProperties.getShutdown());
}

From source file:com.springsource.hq.plugin.tcserver.serverconfig.configuration.serverdefaults.ServerDefaults.java

@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }//w  w w.j  a  v  a2s . co m
    if (!(obj instanceof ServerDefaults)) {
        return false;
    }
    ServerDefaults serverDefaults = (ServerDefaults) obj;
    return ObjectUtils.nullSafeEquals(this.getJspDefaults(), serverDefaults.getJspDefaults())
            && ObjectUtils.nullSafeEquals(this.getStaticDefaults(), serverDefaults.getStaticDefaults());
}

From source file:org.spring.data.gemfire.app.beans.Address.java

@Override
public boolean equals(final Object obj) {
    if (obj == this) {
        return true;
    }//from   w ww  .j a va2 s .co m

    if (!(obj instanceof Address)) {
        return false;
    }

    Address that = (Address) obj;

    return equalsIgnoreNull(this.getId(), that.getId())
            && ObjectUtils.nullSafeEquals(this.getStreet1(), that.getStreet1())
            && ObjectUtils.nullSafeEquals(this.getStreet2(), that.getStreet2())
            && ObjectUtils.nullSafeEquals(this.getCity(), that.getCity())
            && ObjectUtils.nullSafeEquals(this.getState(), that.getState())
            && ObjectUtils.nullSafeEquals(this.getZipCode(), that.getZipCode());
}

From source file:com.springsource.hq.plugin.tcserver.serverconfig.Settings.java

@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }//  w w w .ja  va  2 s . com
    if (!(obj instanceof Settings)) {
        return false;
    }
    Settings settings = (Settings) obj;
    return ObjectUtils.nullSafeEquals(this.getEid(), settings.getEid())
            && ObjectUtils.nullSafeEquals(this.getConfiguration(), settings.getConfiguration())
            && ObjectUtils.nullSafeEquals(this.getDataSources(), settings.getDataSources())
            && ObjectUtils.nullSafeEquals(this.getServices(), settings.getServices());
}

From source file:com.springsource.hq.plugin.tcserver.serverconfig.configuration.context.StaticResourceCache.java

@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }/*ww  w. j  a v  a  2s .c  o  m*/
    if (!(obj instanceof StaticResourceCache)) {
        return false;
    }
    StaticResourceCache staticResourceCache = (StaticResourceCache) obj;
    return ObjectUtils.nullSafeEquals(this.getCacheMaxSize(), staticResourceCache.getCacheMaxSize())
            && ObjectUtils.nullSafeEquals(this.getCacheTTL(), staticResourceCache.getCacheTTL())
            && ObjectUtils.nullSafeEquals(this.getCachingAllowed(), staticResourceCache.getCachingAllowed());
}

From source file:example.app.model.PhoneNumber.java

@Override
public boolean equals(Object obj) {
    if (obj == this) {
        return true;
    }/*from   w ww. ja  v a2 s .c  o  m*/

    if (!(obj instanceof PhoneNumber)) {
        return false;
    }

    PhoneNumber that = (PhoneNumber) obj;

    return ObjectUtils.nullSafeEquals(this.getAreaCode(), that.getAreaCode())
            && ObjectUtils.nullSafeEquals(this.getPrefix(), that.getPrefix())
            && ObjectUtils.nullSafeEquals(this.getSuffix(), that.getSuffix())
            && ObjectUtils.nullSafeEquals(this.getExtension(), that.getExtension());
}

From source file:org.wallride.service.TagService.java

@CacheEvict(value = { WallRideCacheConfiguration.ARTICLE_CACHE,
        WallRideCacheConfiguration.PAGE_CACHE }, allEntries = true)
public Tag updateTag(TagUpdateRequest request, AuthorizedUser authorizedUser) {
    Tag tag = tagRepository.findOneForUpdateByIdAndLanguage(request.getId(), request.getLanguage());
    LocalDateTime now = LocalDateTime.now();

    if (!ObjectUtils.nullSafeEquals(tag.getName(), request.getName())) {
        Tag duplicate = tagRepository.findOneByNameAndLanguage(request.getName(), request.getLanguage());
        if (duplicate != null) {
            throw new DuplicateNameException(request.getName());
        }//from   www.  j  ava 2 s . c o  m
    }

    tag.setName(request.getName());
    tag.setLanguage(request.getLanguage());

    tag.setUpdatedAt(now);
    tag.setUpdatedBy(authorizedUser.toString());

    return tagRepository.saveAndFlush(tag);
}

From source file:dk.teachus.backend.dao.hibernate.PasswordUserType.java

public boolean equals(Object x, Object y) throws HibernateException {
    return ObjectUtils.nullSafeEquals(x, y);
}

From source file:com.springsource.hq.plugin.tcserver.serverconfig.configuration.context.ContextContainer.java

@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }/*ww w  . ja va 2s  .co  m*/
    if (!(obj instanceof ContextContainer)) {
        return false;
    }
    ContextContainer contextContainer = (ContextContainer) obj;
    return ObjectUtils.nullSafeEquals(this.getStaticResourceCache(), contextContainer.getStaticResourceCache())
            && ObjectUtils.nullSafeEquals(this.getWebApplicationLogger(),
                    contextContainer.getWebApplicationLogger());
}