Package com.hypixel.hytale.common.util
Class NetworkUtil
java.lang.Object
com.hypixel.hytale.common.util.NetworkUtil
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic Inet4Addressstatic Inet6Addressstatic Inet4Addressstatic Inet6Address -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanaddressMatchesAll(InetAddress address, NetworkUtil.AddressType... types) static booleanaddressMatchesAny(InetAddress address) static booleanaddressMatchesAny(InetAddress address, NetworkUtil.AddressType... types) private static StringfirstLineIfExists(String path) static InetAddressgetFirstAddressWith(NetworkUtil.AddressType... include) static InetAddressgetFirstAddressWith(NetworkUtil.AddressType[] include, NetworkUtil.AddressType[] exclude) static InetAddressgetFirstAddressWithout(NetworkUtil.AddressType... include) static InetAddressstatic Stringprivate static booleanisAcceptableHostName(String name) private static booleanisIPv4Literal(String name) private static booleanisLikelyIPv6Literal(String name) static StringtoSocketString(InetSocketAddress address)
-
Field Details
-
ANY_IPV6_ADDRESS
-
ANY_IPV4_ADDRESS
-
LOOPBACK_IPV6_ADDRESS
-
LOOPBACK_IPV4_ADDRESS
-
-
Constructor Details
-
NetworkUtil
public NetworkUtil()
-
-
Method Details
-
getFirstNonLoopbackAddress
- Throws:
SocketException
-
getFirstAddressWith
@Nullable public static InetAddress getFirstAddressWith(NetworkUtil.AddressType... include) throws SocketException - Throws:
SocketException
-
getFirstAddressWithout
@Nullable public static InetAddress getFirstAddressWithout(NetworkUtil.AddressType... include) throws SocketException - Throws:
SocketException
-
getFirstAddressWith
@Nullable public static InetAddress getFirstAddressWith(@Nullable NetworkUtil.AddressType[] include, @Nullable NetworkUtil.AddressType[] exclude) throws SocketException - Throws:
SocketException
-
addressMatchesAll
-
addressMatchesAny
-
addressMatchesAny
-
toSocketString
-
getHostName
-
firstLineIfExists
-
isAcceptableHostName
-
isIPv4Literal
-
isLikelyIPv6Literal
-