com.github.xphsc.bean.comparator.ComparableComparator Maven / Gradle / Ivy
package com.github.xphsc.bean.comparator;
import java.io.Serializable;
import java.util.Comparator;
/**
* Created by ${huipei.x} on 2017-8-7.
*/
public class ComparableComparator> implements Comparator, Serializable {
private static final long serialVersionUID = -291439688585137865L;
public static final ComparableComparator INSTANCE = new ComparableComparator();
public static > ComparableComparator comparableComparator() {
return INSTANCE;
}
public ComparableComparator() {
}
public int compare(E obj1, E obj2) {
return obj1.compareTo(obj2);
}
public int hashCode() {
return "ComparableComparator".hashCode();
}
public boolean equals(Object object) {
return this == object || null != object && object.getClass().equals(this.getClass());
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy