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

org.unlaxer.util.collection.Comparators Maven / Gradle / Ivy

The newest version!
package org.unlaxer.util.collection;

import java.util.Comparator;

public class Comparators {
	
	public static final Comparator longerIsFirst = (x,y)->{
		int diff = y.length() - x.length();
		if(diff !=0) {
			return diff;
		}
		return y.compareTo(x);
	};	

	public static final Comparator shoterIsFirst = (y,x)->{
		int diff = y.length() - x.length();
		if(diff !=0) {
			return diff;
		}
		return y.compareTo(x);
	};

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy