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

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

Introduction

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

Prototype

public EqualsBuilder() 

Source Link

Document

Constructor for EqualsBuilder.

Starts off assuming that equals is true.

Usage

From source file:com.base.httpclient.HttpJsonClient.java

public static void main(String[] args) throws ClientProtocolException, IOException, URISyntaxException {
    String rdStr = RandomStringUtils.randomNumeric(9);
    log.info(rdStr);/*  ww  w.j a  v a 2  s. c o m*/
    EqualsBuilder eb = new EqualsBuilder();
    String url = "http://detailskip.taobao.com/json/ifq.htm?id=18278375481&sid=" + rdStr + "&q=1";
    String jsonStr = HttpJsonClient.get(url, null);
    String str = StringUtilsExtends.substringBetween(jsonStr, ":{", "}");
    Map<String, Integer> map = JsonUtil.getMap4Json("{" + str + "}");
    log.info(map.get("quanity") + "");
}

From source file:Main.java

public boolean equals(Object object) {
    if (!(object instanceof Main)) {
        return false;
    }/*w w w . j a  v  a 2 s .com*/

    if (object == this) {
        return true;
    }

    Main book = (Main) object;
    return new EqualsBuilder().append(this.id, book.id).append(this.title, book.title)
            .append(this.author, book.author).isEquals();

    // return EqualsBuilder.reflectionEquals(this, book);

}

From source file:com.pactera.pdts.domain.model.hotel.HotelInfo.java

@Override
public boolean sameValueAs(HotelInfo other) {
    return other != null && new EqualsBuilder().append(this.star, other.star)
            .append(this.hotelers, other.hotelers).append(this.license, other.license).isEquals();
}

From source file:com.hs.mail.util.FileUtils.java

public static boolean startsWith(File file, byte[] magic) {
    InputStream input = null;/*from  ww  w  . j  ava 2 s  .c  o  m*/
    try {
        int magicLen = magic.length;
        byte[] bytes = new byte[magicLen];
        input = new FileInputStream(file);
        input.read(bytes, 0, magicLen);
        return new EqualsBuilder().append(magic, bytes).isEquals();
    } catch (IOException e) {
        return false;
    } finally {
        IOUtils.closeQuietly(input);
    }
}

From source file:com.achep.acdisplay.notifications.NotificationUtils.java

public static boolean equals(StatusBarNotification n, StatusBarNotification n2) {
    return n == n2 || n != null && n2 != null && new EqualsBuilder().append(n.getId(), n2.getId())
            .append(n.getPackageName(), n2.getPackageName()).append(n.getTag(), n2.getTag()).isEquals();
}

From source file:com.clican.pluto.dataprocess.dpl.parser.bean.CombinedKey.java

/**
 * @see java.lang.Object#equals(Object)/*  w w  w  . j  av a  2 s  . co m*/
 */
public boolean equals(Object object) {
    if (!(object instanceof CombinedKey)) {
        return false;
    }
    CombinedKey rhs = (CombinedKey) object;
    return new EqualsBuilder().append(this.name, rhs.name).append(this.value, rhs.value).isEquals();
}

From source file:models.Monitoring.java

public boolean equals(Object obj) {
    if (obj instanceof Monitoring == false) {
        return false;
    }//from  ww w  .j a v a2 s.c  o  m
    if (this == obj) {
        return true;
    }
    Monitoring rhs = (Monitoring) obj;
    return new EqualsBuilder().append(id, rhs.id).isEquals();
}

From source file:de.ailis.jasdoc.types.AbstractType.java

/**
 * @see java.lang.Object#equals(java.lang.Object)
 *//*from w  ww . j  a va  2s  . co m*/
@Override
public final boolean equals(final Object obj) {
    if (obj == null)
        return false;
    if (obj == this)
        return true;
    if (obj.getClass() != getClass())
        return false;
    final AbstractType other = (AbstractType) obj;
    return new EqualsBuilder().append(toExpression(), other.toExpression()).isEquals();
}

From source file:gov.gtas.vo.passenger.HitsDispositionVo.java

@Override
public boolean equals(Object o) {
    if (this == o)
        return true;

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

    HitsDispositionVo that = (HitsDispositionVo) o;

    return new EqualsBuilder().append(hitId, that.hitId).append(caseId, that.caseId).isEquals();
}

From source file:gov.nih.nci.iso21090.QSet.java

/**
 * {@inheritDoc}// www  .j av  a2s  .c  o  m
 */
@Override
public boolean equals(Object obj) {
    if (obj == null) {
        return false;
    }

    if (this == obj) {
        return true;
    }

    if (!(obj instanceof QSet<?>)) {
        return false;
    }

    return new EqualsBuilder().appendSuper(super.equals(obj)).isEquals();
}