Example usage for org.apache.commons.lang3.builder EqualsBuilder EqualsBuilder

List of usage examples for org.apache.commons.lang3.builder EqualsBuilder EqualsBuilder

Introduction

In this page you can find the example usage for org.apache.commons.lang3.builder EqualsBuilder EqualsBuilder.

Prototype

public EqualsBuilder() 

Source Link

Document

Constructor for EqualsBuilder.

Starts off assuming that equals is true.

Usage

From source file:concept.matcher.IsMatcher.java

@Override
public boolean equals(Object obj) {
    // comparing same object (same instance)
    if (this == obj) {
        return true;
    }//w  w w. j  a v a2  s  . c om
    // not same type?
    if (!(obj instanceof IsMatcher)) {
        return false;
    }

    @SuppressWarnings("rawtypes")
    final IsMatcher other = (IsMatcher) obj;

    final EqualsBuilder builder = new EqualsBuilder();
    builder.append(this.getName(), other.getName());
    builder.append(this.getValue(), other.getValue());
    return builder.isEquals();
}

From source file:com.roche.iceboar.cachestorage.StatusInfo.java

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

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

    StatusInfo that = (StatusInfo) o;

    return new EqualsBuilder().append(status, that.status).append(version, that.version).isEquals();
}

From source file:com.omertron.themoviedbapi.model.Trailer.java

@Override
public boolean equals(Object obj) {
    if (obj instanceof Trailer) {
        final Trailer other = (Trailer) obj;
        return new EqualsBuilder().append(name, other.name).append(size, other.size)
                .append(source, other.source).isEquals();
    } else {/*from  ww  w .j a va  2  s .c  o  m*/
        return false;
    }
}

From source file:eu.codesketch.adam.rest.domain.model.Image.java

@Override
public boolean equals(Object obj) {
    if (null == obj) {
        return false;
    }/*  ww  w  . j a  va2  s  .co  m*/
    if (this == obj) {
        return true;
    }
    if (!getClass().equals(obj.getClass())) {
        return false;
    }
    Image other = (Image) obj;
    return new EqualsBuilder().append(this.id, other.id).isEquals();
}

From source file:io.cloudslang.lang.entities.bindings.Input.java

@Override
public boolean equals(Object o) {
    if (this == o) {
        return true;
    }//from   w w w .jav a 2  s.com

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

    Input input = (Input) o;

    return new EqualsBuilder().appendSuper(super.equals(o)).append(required, input.required)
            .append(privateInput, input.privateInput).isEquals();
}

From source file:com.anrisoftware.sscontrol.firewall.statements.Address.java

@Override
public boolean equals(Object obj) {
    if (obj == null) {
        return false;
    }//from   w  w  w .j  a va2  s . c o m
    if (obj == this) {
        return true;
    }
    if (obj.getClass() != getClass()) {
        return false;
    }
    Address rhs = (Address) obj;
    return new EqualsBuilder().append(address, rhs.address).isEquals();
}

From source file:com.github.naoghuman.abclist.model.NavigationEntity.java

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

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

    final NavigationEntity other = (NavigationEntity) obj;
    return new EqualsBuilder().append(this.getNavigation().getEntityId(), other.getNavigation().getEntityId())
            .append(this.getNavigation().getNavigationType(), other.getNavigation().getNavigationType())
            .isEquals();
}

From source file:com.silverpeas.gallery.web.MediaEntityMatcher.java

@SuppressWarnings("unchecked")
@Override/*  w  w  w.  j a  v  a2  s .  c  om*/
public boolean matches(final Object item) {
    boolean match = false;
    if (item instanceof LinkedHashMap) {
        final AbstractMediaEntity actual = from((LinkedHashMap<String, Object>) item);
        final EqualsBuilder matcher = new EqualsBuilder();
        matcher.appendSuper(actual.getURI().toString().endsWith("/gallery/componentName5/albums/3/"
                + expected.getType().getMediaWebUriPart() + "/" + expected.getId()));
        matcher.appendSuper(actual.getParentURI().toString().endsWith("/gallery/componentName5/albums/3"));
        matcher.append(expected.getType(), actual.getType());
        matcher.append(expected.getId(), actual.getId());
        matcher.append(expected.getTitle(), actual.getTitle());
        matcher.append(expected.getDescription(), actual.getDescription());
        // URL
        if (expected.getInternalMedia() != null) {
            matcher.appendSuper(actual.getUrl().toString()
                    .endsWith("/gallery/componentName5/" + expected.getType().getMediaWebUriPart() + "/"
                            + expected.getId() + "/content?_t=1325372400000"));
        } else {
            matcher.appendSuper(
                    actual.getUrl().toString().equals("/homepageUrl/componentName5/" + expected.getId()));
        }
        // Other URLs
        if (expected.getType().isPhoto()) {
            PhotoEntity photoEntity = (PhotoEntity) actual;
            matcher.appendSuper(photoEntity.getPreviewUrl().toString()
                    .contains("/silverpeas/services/gallery/componentName5/photos/7/content?_t=1325372400000"
                            + "&resolution=PREVIEW"));
            matcher.appendSuper(photoEntity.getThumbUrl().toString()
                    .contains("/silverpeas/gallery/jsp/icons/notAvailable_fr_133x100.jpg"));
        } else {
            matcher.appendSuper(actual.getThumbUrl().toString().equals("/silverpeas/gallery/jsp/icons/"
                    + expected.getType().getName().toLowerCase() + "_266x150.png"));
        }
        match = matcher.isEquals();
    }
    return match;
}

From source file:net.mindengine.galen.specs.page.Locator.java

@Override
public boolean equals(Object obj) {
    if (obj == null) {
        return false;
    }//from   w  ww  .  j a  va 2  s.c  om
    if (obj == this) {
        return true;
    }
    if (!(obj instanceof Locator)) {
        return false;
    }
    Locator rhs = (Locator) obj;
    return new EqualsBuilder().append(locatorType, rhs.locatorType).append(locatorValue, rhs.locatorValue)
            .append(getCorrections(), rhs.getCorrections()).isEquals();
}

From source file:de.kaiserpfalzEdv.infopir.backend.db.auth.Role.java

@Override
public boolean equals(Object obj) {
    if (obj == null) {
        return false;
    }/*from   w w w  . j  a va2 s.c  o m*/
    if (obj == this) {
        return true;
    }
    if (obj.getClass() != getClass()) {
        return false;
    }
    Role rhs = (Role) obj;
    return new EqualsBuilder().append(this.name, rhs.name).isEquals();
}