com.mitchellbosecke.pebble.utils.StringLengthComparator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pebble Show documentation
Show all versions of pebble Show documentation
Templating engine for Java.
/*******************************************************************************
* This file is part of Pebble.
*
* Copyright (c) 2014 by Mitchell Bösecke
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
******************************************************************************/
package com.mitchellbosecke.pebble.utils;
public class StringLengthComparator implements java.util.Comparator {
public StringLengthComparator() {
super();
}
public int compare(String s1, String s2) {
int dist1 = Math.abs(s1.length());
int dist2 = Math.abs(s2.length());
return dist2 - dist1;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy