// Generated by delombok at Tue Dec 16 19:36:13 UTC 2025
package net.md_5.bungee.util;

import com.google.common.base.Preconditions;
import java.net.Inet6Address;
import java.net.InetSocketAddress;

public class AddressUtil {
    public static String sanitizeAddress(InetSocketAddress addr) {
        Preconditions.checkArgument(!addr.isUnresolved(), "Unresolved address");
        String string = addr.getAddress().getHostAddress();
        // Remove IPv6 scope if present
        if (addr.getAddress() instanceof Inet6Address) {
            int strip = string.indexOf('%');
            return (strip == -1) ? string : string.substring(0, strip);
        } else {
            return string;
        }
    }

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    private AddressUtil() {
    }
}
