Added LOCALHOST_STRING and WILDCARD_STRING to IPv4/6

master Version_2.19
Robinson 2022-08-19 20:51:33 +02:00
parent 34fc27fa18
commit b2357824fc
No known key found for this signature in database
GPG Key ID: 8E7DB78588BD6F5C
5 changed files with 32 additions and 4 deletions

View File

@ -21,7 +21,7 @@ Maven Info
<dependency>
<groupId>com.dorkbox</groupId>
<artifactId>NetworkUtils</artifactId>
<version>2.18</version>
<version>2.19</version>
</dependency>
</dependencies>
```
@ -30,7 +30,7 @@ Gradle Info
```
dependencies {
...
implementation("com.dorkbox:NetworkUtils:2.18")
implementation("com.dorkbox:NetworkUtils:2.19")
}
```

View File

@ -39,7 +39,7 @@ object Extras {
// set for the project
const val description = "Utilities for managing network configurations, IP/MAC address conversion, and ping (via OS native commands)"
const val group = "com.dorkbox"
const val version = "2.18"
const val version = "2.19"
// set as project.ext
const val name = "NetworkUtils"

View File

@ -30,7 +30,7 @@ internal object Common {
/**
* Gets the version number.
*/
const val version = "2.18"
const val version = "2.19"
val OS_LINUX: Boolean
val OS_WINDOWS: Boolean

View File

@ -98,6 +98,13 @@ object IPv4 {
InetAddress.getByAddress("localhost", byteArrayOf(127, 0, 0, 1)) as Inet4Address
}
/**
* The [String] that represents the IPv4 loopback address '127.0.0.1'
*/
val LOCALHOST_STRING by lazy {
toString(LOCALHOST)
}
/**
* The [Inet4Address] that represents the IPv4 wildcard address '0.0.0.0'
*/
@ -106,6 +113,13 @@ object IPv4 {
InetAddress.getByAddress(null, byteArrayOf(0, 0, 0, 0)) as Inet4Address
}
/**
* The [String] that represents the IPv4 wildcard address '0.0.0.0'
*/
val WILDCARD_STRING by lazy {
toString(WILDCARD)
}
/**
* the length of an address in this particular family.
*/

View File

@ -134,6 +134,13 @@ object IPv6 {
InetAddress.getByAddress("localhost", byteArrayOf(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1)) as Inet6Address
}
/**
* The [String] that represents the IPv6 loopback address '::1'
*/
val LOCALHOST_STRING by lazy {
toString(LOCALHOST)
}
/**
* The [Inet4Address] that represents the IPv6 wildcard address '0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0'
*/
@ -142,6 +149,13 @@ object IPv6 {
InetAddress.getByAddress(null, byteArrayOf(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)) as Inet6Address
}
/**
* The [String] that represents the IPv6 wildcard address '0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0'
*/
val WILDCARD_STRING by lazy {
toString(WILDCARD)
}
/**
* the length of an address in this particular family.
*/