Example usage for com.google.common.collect ComparisonChain start

List of usage examples for com.google.common.collect ComparisonChain start

Introduction

In this page you can find the example usage for com.google.common.collect ComparisonChain start.

Prototype

public static ComparisonChain start() 

Source Link

Document

Begins a new chained comparison statement.

Usage

From source file:org.spongepowered.common.data.manipulator.immutable.entity.ImmutableSpongeArmorStandData.java

@Override
public int compareTo(ImmutableArmorStandData o) {
    return ComparisonChain.start().compare(o.arms().get(), this.arms).compare(o.marker().get(), this.marker)
            .compare(o.basePlate().get(), this.basePlate).compare(o.gravity().get(), this.gravity)
            .compare(o.small().get(), this.small).result();
}

From source file:org.spongepowered.common.data.manipulator.mutable.entity.SpongeArmorStandData.java

@Override
public int compareTo(ArmorStandData o) {
    return ComparisonChain.start().compare(o.arms().get(), this.arms).compare(o.marker().get(), this.marker)
            .compare(o.basePlate().get(), this.basePlate).compare(o.gravity().get(), this.gravity)
            .compare(o.small().get(), this.small).result();
}

From source file:org.apache.hadoop.hdfs.server.namenode.CheckpointSignature.java

@Override
public int compareTo(CheckpointSignature o) {
    return ComparisonChain.start().compare(layoutVersion, o.layoutVersion).compare(namespaceID, o.namespaceID)
            .compare(cTime, o.cTime).compare(mostRecentCheckpointTxId, o.mostRecentCheckpointTxId)
            .compare(curSegmentTxId, o.curSegmentTxId).compare(clusterID, o.clusterID)
            .compare(blockpoolID, o.blockpoolID).result();
}

From source file:things.thing.Thing.java

@Override
public int compareTo(Thing o) {
    return ComparisonChain.start().compare(getThingType(), o.getThingType()).compare(getKey(), o.getKey())
            //.compare(getValue(), o.getValue(), valueComparator)
            //.compare(getValue(), o.getValue(), Ordering.natural().nullsFirst())
            .compare(getId(), o.getId(), Ordering.natural().nullsFirst()).result();
}

From source file:org.dllearner.algorithms.qtl.datastructures.impl.EvaluatedRDFResourceTree.java

@Override
public int compareTo(EvaluatedRDFResourceTree other) {
    return ComparisonChain.start().compare(other.getScore(), this.getScore()) // score
            .compare(this.baseQueryTrees.toString(), other.baseQueryTrees.toString()) // base query trees
            .compare(this.asEvaluatedDescription(), other.asEvaluatedDescription()) // class expression representation
            .result();/*from   www .  j  a v  a 2 s . co m*/
}

From source file:com.facebook.buck.android.RDotTxtEntry.java

/**
 * A collection of Resources should be sorted such that Resources of the same type should be
 * grouped together, and should be alphabetized within that group.
 *//*from  ww  w. j  av  a  2s  .  c o  m*/
@Override
public int compareTo(RDotTxtEntry that) {
    return ComparisonChain.start().compare(this.type, that.type).compare(this.name, that.name).result();
}

From source file:org.jclouds.glacier.domain.MultipartUploadMetadata.java

@Override
public int compareTo(MultipartUploadMetadata o) {
    return ComparisonChain.start().compare(this.creationDate, o.creationDate).result();
}

From source file:com.devnexus.ting.model.ConferenceDay.java

@Override
public int compareTo(final ConferenceDay other) {
    return ComparisonChain.start().compare(day, other.day).result();
}

From source file:be.Balor.Tools.Compatibility.MinecraftVersion.java

@Override
public int compareTo(final MinecraftVersion o) {
    if (o == null) {
        return 1;
    }//from  w  w  w.j a  v  a  2 s.  c o  m

    return ComparisonChain.start().compare(getMajor(), o.getMajor()).compare(getMinor(), o.getMinor())
            .compare(getBuild(), o.getBuild()).
            // No development String means it's a release
            compare(getDevelopmentStage(), o.getDevelopmentStage(), Ordering.natural().nullsLast()).result();
}

From source file:org.spongepowered.common.data.manipulator.mutable.tileentity.SpongeBeaconData.java

@Override
public int compareTo(BeaconData o) {
    ComparisonChain compare = ComparisonChain.start()
            .compare(this.primaryEffect().exists(), o.primaryEffect().exists())
            .compare(this.secondaryEffect().exists(), o.secondaryEffect().exists());
    if (this.primaryEffect().exists() && o.primaryEffect().exists()) {
        compare = compare//from www . j  av a  2s  . c o  m
                .compare(this.primaryEffect().get().get().getName(), o.primaryEffect().get().get().getName())
                .compare(this.primaryEffect().get().get().isInstant(),
                        o.primaryEffect().get().get().isInstant());
    }
    if (this.secondaryEffect().exists() && o.secondaryEffect().exists()) {
        compare = compare
                .compare(this.secondaryEffect().get().get().getName(),
                        o.secondaryEffect().get().get().getName())
                .compare(this.secondaryEffect().get().get().isInstant(),
                        o.secondaryEffect().get().get().isInstant());
    }
    return compare.result();
}