com.jparams.store.index.comparison.string.CaseInsensitiveComparisonPolicy Maven / Gradle / Ivy
package com.jparams.store.index.comparison.string;
import java.util.Locale;
import com.jparams.store.index.comparison.ComparisonPolicy;
/**
* Comparison policy for comparing two string elements regardless of case.
*/
public class CaseInsensitiveComparisonPolicy implements ComparisonPolicy
{
@Override
public boolean supports(final Class> clazz)
{
return clazz == String.class;
}
@Override
public String createComparable(final String item)
{
return item.toLowerCase(Locale.getDefault());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy