diff options
Diffstat (limited to 'app/src/main/java/org/pacien/tincapp/data/CidrAddress.kt')
-rw-r--r-- | app/src/main/java/org/pacien/tincapp/data/CidrAddress.kt | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/app/src/main/java/org/pacien/tincapp/data/CidrAddress.kt b/app/src/main/java/org/pacien/tincapp/data/CidrAddress.kt index f3a7ea8..510ebc9 100644 --- a/app/src/main/java/org/pacien/tincapp/data/CidrAddress.kt +++ b/app/src/main/java/org/pacien/tincapp/data/CidrAddress.kt | |||
@@ -6,9 +6,7 @@ import org.apache.commons.configuration2.ex.ConversionException | |||
6 | * @author pacien | 6 | * @author pacien |
7 | */ | 7 | */ |
8 | data class CidrAddress(val address: String, val prefix: Int) { | 8 | data class CidrAddress(val address: String, val prefix: Int) { |
9 | |||
10 | companion object { | 9 | companion object { |
11 | |||
12 | private val SEPARATOR = "/" | 10 | private val SEPARATOR = "/" |
13 | 11 | ||
14 | fun fromSlashSeparated(s: String) = try { | 12 | fun fromSlashSeparated(s: String) = try { |
@@ -16,9 +14,7 @@ data class CidrAddress(val address: String, val prefix: Int) { | |||
16 | } catch (e: Exception) { | 14 | } catch (e: Exception) { |
17 | throw ConversionException(e.message, e) | 15 | throw ConversionException(e.message, e) |
18 | } | 16 | } |
19 | |||
20 | } | 17 | } |
21 | 18 | ||
22 | fun toSlashSeparated() = address + SEPARATOR + prefix | 19 | fun toSlashSeparated() = address + SEPARATOR + prefix |
23 | |||
24 | } | 20 | } |