io.codemodder.CodemodExecutionPriority Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of codemodder-base Show documentation
Show all versions of codemodder-base Show documentation
Base framework for writing codemods in Java
package io.codemodder;
import java.util.Comparator;
/**
* A description of how important it is that a codemod execute in the list of codemods being run.
*/
public enum CodemodExecutionPriority {
LOW(0),
NORMAL(1),
HIGH(2);
private final int level;
CodemodExecutionPriority(final int level) {
this.level = level;
}
/**
* Expose a package-protected comparator so nobody else needs to worry about how our priority is
* actually established.
*/
static final Comparator priorityOrderComparator =
(p1, p2) -> Integer.compare(p2.level, p1.level);
}