
package de.ivu.elect.jee.faces;

import java.io.Serializable;
import java.util.Comparator;

public class EnumByLokalisierungComparator<E extends Enum> implements Comparator<E>, Serializable {

  private static final long serialVersionUID = 1L;

  private final Messages messages;

  public EnumByLokalisierungComparator(Messages messages) {
    super();

    this.messages = messages;
  }

  @Override
  public int compare(E o1, E o2) {
    return messages.lokalisiere(o1).compareTo(messages.lokalisiere(o2));
  }
}
