Skip to content

Commit

Permalink
more javadoc
Browse files Browse the repository at this point in the history
Signed-off-by: garyschulte <[email protected]>
  • Loading branch information
garyschulte committed Jan 31, 2024
1 parent 3182c68 commit 7dc8bc7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions util/src/main/java/org/hyperledger/besu/util/NetworkUtility.java
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,12 @@ public static boolean isPortAvailable(final int port) {
return isPortAvailableForTcp(port) && isPortAvailableForUdp(port);
}


/**
* Is hostAddress string an ip v4 address
* @param hostAddress the host address as a string
* @return true if the host address is an ip v4 address
*/
public static boolean isIpV4Address(final String hostAddress) {
try {
return InetAddresses.forString(hostAddress) instanceof Inet4Address;
Expand All @@ -205,6 +211,11 @@ public static boolean isIpV4Address(final String hostAddress) {
}
}

/**
* Is hostAddress string an ip v6 address
* @param hostAddress the host address as a string
* @return true if the host address is an ip v6 address
*/
public static boolean isIpV6Address(final String hostAddress) {
try {
return InetAddresses.forString(hostAddress) instanceof Inet6Address;
Expand Down

0 comments on commit 7dc8bc7

Please sign in to comment.