com.softicar.platform.common.core.item.BasicItemComparator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of platform-common Show documentation
Show all versions of platform-common Show documentation
The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.
package com.softicar.platform.common.core.item;
import java.util.Comparator;
/**
* A simple comparator that is based on the ID of the basic items.
*
* @author Oliver Richers
*/
public final class BasicItemComparator implements Comparator {
private static final BasicItemComparator INSTANCE = new BasicItemComparator();
private BasicItemComparator() {
// private to make it a singleton
}
public static BasicItemComparator get() {
return INSTANCE;
}
@Override
public int compare(IBasicItem item1, IBasicItem item2) {
return item1.getItemId().compareTo(item2.getItemId());
}
}