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:me.yanaga.opes.Cnpj.java

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

From source file:org.dcache.pool.nearline.json.NearlineData.java

@Override
public int compareTo(NearlineData o) {
    return ComparisonChain.start().compare(created, o.created).compare(activated, o.activated)
            .compare(state, o.state).compare(storageClass, o.storageClass).compare(pnfsId, o.pnfsId).result();
}

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

@Override
public int compareTo(FireworkData o) {
    return ComparisonChain.start()
            .compare(o.effects().containsAll(this.fireworkEffects),
                    this.fireworkEffects.containsAll(o.effects().get()))
            .compare(o.flightModifier().get().intValue(), this.flightModifier).result();
}

From source file:org.dcache.pool.movers.json.MoverData.java

@Override
public int compareTo(MoverData o) {
    return ComparisonChain.start().compare(startTime, o.startTime).compare(lastModified, o.lastModified)
            .compare(state, o.state).compare(door, o.door).compare(pnfsId, o.pnfsId).result();
}

From source file:eu.lp0.cursus.db.data.Penalty.java

@Override
public int compareTo(Penalty o) {
    return ComparisonChain.start().compare(getType(), o.getType()).compare(o.getValue(), getValue())
            .compare(getReason(), o.getReason()).result();
}

From source file:com.opengamma.strata.collect.tuple.Pair.java

/**
 * Compares the pair based on the first element followed by the second element.
 * <p>/*from w  w w. j a v a  2s  .c  o m*/
 * The element types must be {@code Comparable}.
 * 
 * @param other  the other pair
 * @return negative if this is less, zero if equal, positive if greater
 * @throws ClassCastException if either object is not comparable
 */
@Override
public int compareTo(Pair<A, B> other) {
    return ComparisonChain.start().compare((Comparable<?>) first, (Comparable<?>) other.first)
            .compare((Comparable<?>) second, (Comparable<?>) other.second).result();
}

From source file:me.fromgate.reactions.activators.Activator.java

@Override
public int compareTo(Activator o) {
    return ComparisonChain.start().compare(o.name, name, String.CASE_INSENSITIVE_ORDER).compare(o.group, group)
            .result();//  ww w.ja  va  2 s .com
}

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

@Override
public int compareTo(ImmutableMovementSpeedData o) {
    return ComparisonChain.start().compare(o.walkSpeed().get().doubleValue(), this.walkSpeed)
            .compare(o.flySpeed().get().doubleValue(), this.flySpeed).result();
}

From source file:com.android.repository.impl.meta.RepoPackageImpl.java

@Override
public int compareTo(@NonNull RepoPackage o) {
    int result = ComparisonChain.start().compare(getPath(), o.getPath()).compare(getVersion(), o.getVersion())
            .result();/*from  w  ww .j a va2s  .co m*/
    if (result != 0) {
        return result;
    }
    if ((this instanceof LocalPackage ^ o instanceof LocalPackage)
            || (this instanceof RemotePackage ^ o instanceof RemotePackage)) {
        return getClass().getName().compareTo(o.getClass().getName());
    }
    return 0;
}

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

@Override
public int compareTo(ImmutableFoodData o) {
    return ComparisonChain.start().compare(o.foodLevel().get().intValue(), this.foodLevel)
            .compare(o.saturation().get().floatValue(), this.foodSaturationLevel)
            .compare(o.exhaustion().get().floatValue(), this.foodExhaustionLevel).result();
}