Example usage for org.apache.commons.lang3.builder CompareToBuilder build

List of usage examples for org.apache.commons.lang3.builder CompareToBuilder build

Introduction

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

Prototype

@Override
public Integer build() 

Source Link

Document

Returns a negative Integer, a positive Integer, or zero as the builder has judged the "left-hand" side as less than, greater than, or equal to the "right-hand" side.

Usage

From source file:com.medlog.webservice.vo.StateVO.java

@Override
public int compareTo(StateVO that) {
    CompareToBuilder b = new CompareToBuilder();
    b.append(this.getStateName().toLowerCase(), that.getStateName().toLowerCase());
    b.append(this.getStateAbbreviation(), that.getStateAbbreviation());
    return b.build();
}

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

@Override
public int compareTo(TopicVO _that) {
    if (_that == null) {
        return 1;
    }/*from  w w w.  j ava2s. c  om*/
    CompareToBuilder ctb = new CompareToBuilder();
    ctb.append(this.getTopicID() > 0, _that.getTopicID() > 0);
    ctb.append(this.getTopicID(), _that.getTopicID());
    ctb.append(this.getTopicName().toLowerCase().trim(), _that.getTopicName().toLowerCase().trim());
    return ctb.build();
}

From source file:com.medlog.webservice.vo.MedicationVO.java

@Override
public int compareTo(MedicationVO that) {
    CompareToBuilder ctb = new CompareToBuilder();
    ctb.append(this.getMedicationID(), that.getMedicationID());
    try {/*ww w.  j a v  a  2s.  c om*/
        ctb.append(this.getPharmID().getPharmID(), that.getPharmID().getPharmID());
    } catch (Exception e) {

    }
    return ctb.build();
}