net.md_5.bungee.util.CaseInsensitiveHashingStrategy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bungeecord-api Show documentation
Show all versions of bungeecord-api Show documentation
API implemented by the Elastic Portal Suite
package net.md_5.bungee.util;
import gnu.trove.strategy.HashingStrategy;
import java.util.Locale;
class CaseInsensitiveHashingStrategy implements HashingStrategy
{
static final CaseInsensitiveHashingStrategy INSTANCE = new CaseInsensitiveHashingStrategy();
@Override
public int computeHashCode(Object object)
{
return ( (String) object ).toLowerCase( Locale.ROOT ).hashCode();
}
@Override
public boolean equals(Object o1, Object o2)
{
return o1.equals( o2 ) || ( o1 instanceof String && o2 instanceof String && ( (String) o1 ).toLowerCase( Locale.ROOT ).equals( ( (String) o2 ).toLowerCase( Locale.ROOT ) ) );
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy