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

se.bjurr.violations.lib.ORDERED_BY Maven / Gradle / Ivy

There is a newer version: 1.157.3
Show newest version
package se.bjurr.violations.lib;

import java.util.Comparator;

import se.bjurr.violations.lib.model.Violation;

public enum ORDERED_BY {
 FILE(new Comparator() {
  @Override
  public int compare(Violation o1, Violation o2) {
   return o1.getFile().compareTo(o2.getFile());
  }
 }), SEVERITY(new Comparator() {
  @Override
  public int compare(Violation o1, Violation o2) {
   return new Integer(o1.getSeverity().ordinal())//
     .compareTo(new Integer(o2.getSeverity().ordinal()));
  }
 });
 private Comparator comparator;

 private ORDERED_BY(Comparator comparable) {
  this.comparator = comparable;
 }

 public Comparator getComparator() {
  return comparator;
 }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy