All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cucumber.runtime.HookComparator Maven / Gradle / Ivy

There is a newer version: 1.2.6
Show newest version
package cucumber.runtime;

import java.util.Comparator;

public final class HookComparator implements Comparator {
    final boolean ascending;

    public HookComparator(boolean ascending) {
        this.ascending = ascending;
    }

    @Override
    public int compare(HookDefinition hook1, HookDefinition hook2) {
        int comparison = hook1.getOrder() - hook2.getOrder();
        return ascending ? comparison : -comparison;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy