Contents
- Description
- Nested Class Summary
- Field Summary
- Constructor Summary
- Method Summary
- Field Details
- Constructor Details
- Method Details
- getFirstNonLoopbackAddress()
- getFirstAddressWith(NetworkUtil.AddressType...)
- getFirstAddressWithout(NetworkUtil.AddressType...)
- getFirstAddressWith(NetworkUtil.AddressType[], NetworkUtil.AddressType[])
- addressMatchesAll(InetAddress, NetworkUtil.AddressType...)
- addressMatchesAny(InetAddress)
- addressMatchesAny(InetAddress, NetworkUtil.AddressType...)
- toSocketString(InetSocketAddress)
- getHostName()
Class NetworkUtil
java.lang.Object
com.hypixel.hytale.common.util.NetworkUtil
- Since:
- 25/1/17.
- Version:
- 1.0
-
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) static InetAddressgetFirstAddressWith(NetworkUtil.AddressType... include) static InetAddressgetFirstAddressWith(NetworkUtil.AddressType[] include, NetworkUtil.AddressType[] exclude) static InetAddressgetFirstAddressWithout(NetworkUtil.AddressType... include) static InetAddressstatic Stringstatic StringtoSocketString(InetSocketAddress address) Returns a textual representation of anInetSocketAddress.
-
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
public static boolean addressMatchesAll(InetAddress address, @Nonnull NetworkUtil.AddressType... types) -
addressMatchesAny
-
addressMatchesAny
public static boolean addressMatchesAny(InetAddress address, @Nonnull NetworkUtil.AddressType... types) -
toSocketString
Returns a textual representation of anInetSocketAddress. Addresses that contain a hostname (either resolved, or manually specified) will use the<hostname>:<port>representation. Otherwise,<ipv4>:portor[<ipv6>]:<port>is used, depending on the address type.- Parameters:
address- The address- Returns:
- The string
-
getHostName
-