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

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

Introduction

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

Prototype

public EqualsBuilder append(final boolean[] lhs, final boolean[] rhs) 

Source Link

Document

Deep comparison of array of boolean.

Usage

From source file:org.smurn.jply.ElementType.java

@Override
public boolean equals(final Object obj) {
    if (obj == null) {
        return false;
    }//from www  . j a  va2s.c  o m
    if (obj == this) {
        return true;
    }
    if (obj.getClass() != getClass()) {
        return false;
    }
    ElementType rhs = (ElementType) obj;
    EqualsBuilder builder = new EqualsBuilder();
    builder.append(name, rhs.name);
    builder.append(properties, rhs.properties);
    return builder.isEquals();
}

From source file:org.smurn.jply.ListProperty.java

@Override
public boolean equals(final Object obj) {
    if (obj == null) {
        return false;
    }/*  w  ww . j a v  a 2s .  co m*/
    if (obj == this) {
        return true;
    }
    if (obj.getClass() != getClass()) {
        return false;
    }
    ListProperty rhs = (ListProperty) obj;
    EqualsBuilder builder = new EqualsBuilder();
    builder.appendSuper(super.equals(obj));
    builder.append(countType, rhs.countType);
    return builder.isEquals();
}

From source file:org.smurn.jply.Property.java

@Override
public boolean equals(final Object obj) {
    if (obj == null) {
        return false;
    }//from   w  w  w  . j  ava 2  s  .c  o m
    if (obj == this) {
        return true;
    }
    if (obj.getClass() != getClass()) {
        return false;
    }
    Property rhs = (Property) obj;
    EqualsBuilder builder = new EqualsBuilder();
    builder.append(name, rhs.name);
    builder.append(type, rhs.type);
    return builder.isEquals();
}

From source file:org.smurn.jsift.ScaleSpacePoint.java

@Override
public boolean equals(Object obj) {
    if (obj == null) {
        return false;
    }/*from  w  w w. jav a 2  s.  co  m*/
    if (obj == this) {
        return true;
    }
    if (obj.getClass() != getClass()) {
        return false;
    }
    ScaleSpacePoint other = (ScaleSpacePoint) obj;
    EqualsBuilder builder = new EqualsBuilder();
    builder.append(x, other.x);
    builder.append(y, other.y);
    builder.append(sigma, other.sigma);
    return builder.build();
}

From source file:org.spout.vanilla.entity.component.pathfinding.PathNode.java

@Override
public boolean equals(Object obj) {
    if (obj instanceof PathNode == false) {
        return false;
    }//from  w  ww .  ja va2  s .c om
    if (this == obj) {
        return true;
    }
    PathNode other = (PathNode) obj;
    EqualsBuilder builder = new EqualsBuilder();
    return builder.append(x, other.getX()).append(y, other.getY()).append(z, other.getZ()).isEquals();
}

From source file:org.spout.vanilla.protocol.msg.entity.EntityPropertiesMessage.java

@Override
public boolean equals(Object obj) {
    if (obj == null) {
        return false;
    }/* w w  w  .  j ava  2s . c o  m*/
    if (getClass() != obj.getClass()) {
        return false;
    }
    final EntityPropertiesMessage other = (EntityPropertiesMessage) obj;
    EqualsBuilder equalsBuilder = new org.apache.commons.lang3.builder.EqualsBuilder()
            .append(this.getEntityId(), other.getEntityId());
    if (this.properties.size() == other.properties.size()) {
        Iterator<Map.Entry<EntityProperties, Double>> iterator = other.properties.entrySet().iterator();
        for (Map.Entry<EntityPropertiesMessage.EntityProperties, Double> value : properties.entrySet()) {
            Map.Entry<EntityProperties, Double> otherValue = iterator.next();
            equalsBuilder.append(value.getKey(), otherValue.getKey());
            equalsBuilder.append(value.getValue(), otherValue.getValue());
        }
    } else {
        return false;
    }
    return equalsBuilder.isEquals();
}

From source file:org.talend.daikon.properties.PropertiesImpl.java

boolean computeEqualityWith(Properties current, Properties other) {
    final EqualsBuilder equalsBuilder = new EqualsBuilder();
    List<NamedThing> properties = current.getProperties();
    for (NamedThing nt : properties) {
        if (nt instanceof PropertiesImpl) {
            equalsBuilder.append(nt, other.getProperties(nt.getName()));
        } else if (nt instanceof Property<?>) {
            equalsBuilder.append(nt, other.getValuedProperty(nt.getName()));
        }/*from  w  w  w  .j  av  a 2  s  . c o  m*/
    }
    return equalsBuilder.isEquals();

}

From source file:org.topology.bgp_ls.config.nodes.impl.RoutingProcessorConfigurationImpl.java

@Override
public boolean equals(Object obj) {
    if (!(obj instanceof RoutingProcessorConfiguration))
        return false;

    RoutingProcessorConfiguration o = (RoutingProcessorConfiguration) obj;

    EqualsBuilder builder = (new EqualsBuilder()).append(getRoutingInstances().size(),
            o.getRoutingInstances().size());

    if (builder.isEquals()) {
        Iterator<RoutingInstanceConfiguration> lit = getRoutingInstances().iterator();
        Iterator<RoutingInstanceConfiguration> rit = o.getRoutingInstances().iterator();

        while (lit.hasNext())
            builder.append(lit.next(), rit.next());
    }//from  w w w.  ja  va 2 s .co m

    return builder.isEquals();
}

From source file:org.topology.bgp_ls.net.attributes.MultiProtocolNLRI.java

@Override
protected boolean subclassEquals(PathAttribute obj) {
    MultiProtocolNLRI o = (MultiProtocolNLRI) obj;

    EqualsBuilder builer = (new EqualsBuilder()).append(getPathAttributeType(), o.getPathAttributeType())
            .append(getAddressFamily(), o.getAddressFamily())
            .append(getSubsequentAddressFamily(), o.getSubsequentAddressFamily())
            .append(getNextHop(), o.getNextHop()).append(getNlris().size(), o.getNlris().size());

    if (builer.isEquals()) {
        Iterator<MultiProtocolNLRIInformation> lit = getNlris().iterator();
        Iterator<MultiProtocolNLRIInformation> rit = o.getNlris().iterator();

        while (lit.hasNext())
            builer.append(lit.next(), rit.next());
    }/*from  ww  w .j  a va2  s .  co  m*/

    return builer.isEquals();
}

From source file:org.xwiki.extension.AbstractExtensionDependency.java

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

    boolean equals;

    if (obj instanceof ExtensionDependency) {
        ExtensionDependency otherDependency = (ExtensionDependency) obj;

        EqualsBuilder builder = new EqualsBuilder();

        builder.append(getId(), otherDependency.getId());
        builder.append(getVersionConstraint(), otherDependency.getVersionConstraint());
        builder.append(getRepositories(), otherDependency.getRepositories());

        equals = builder.isEquals();
    } else {
        equals = false;
    }

    return equals;
}