diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2020-01-09 19:56:32 +0000 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2020-02-11 17:32:20 +0000 |
| commit | d78724716722c7eb1ea321ccab483020e124134e (patch) | |
| tree | 33d91487b728d0df8a4a43d11a3c3019e8a04aa3 /android/src | |
| parent | bef6fced446982fa1d20e73a9f29bd867bfc4b5c (diff) | |
| download | mullvadvpn-d78724716722c7eb1ea321ccab483020e124134e.tar.xz mullvadvpn-d78724716722c7eb1ea321ccab483020e124134e.zip | |
Derive `FromJava` for `LocationConstraint`
Diffstat (limited to 'android/src')
| -rw-r--r-- | android/src/main/kotlin/net/mullvad/mullvadvpn/model/LocationConstraint.kt | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/model/LocationConstraint.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/model/LocationConstraint.kt index 302a464eaf..039f10a411 100644 --- a/android/src/main/kotlin/net/mullvad/mullvadvpn/model/LocationConstraint.kt +++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/model/LocationConstraint.kt @@ -1,11 +1,20 @@ package net.mullvad.mullvadvpn.model sealed class LocationConstraint(val code: Array<String>) { - class Country(var countryCode: String) : LocationConstraint(arrayOf(countryCode)) + class Country(var countryCode: String) : LocationConstraint(arrayOf(countryCode)) { + fun get0() = countryCode + } class City(var countryCode: String, var cityCode: String) : - LocationConstraint(arrayOf(countryCode, cityCode)) + LocationConstraint(arrayOf(countryCode, cityCode)) { + fun get0() = countryCode + fun get1() = cityCode + } class Hostname(var countryCode: String, var cityCode: String, var hostname: String) : - LocationConstraint(arrayOf(countryCode, cityCode, hostname)) + LocationConstraint(arrayOf(countryCode, cityCode, hostname)) { + fun get0() = countryCode + fun get1() = cityCode + fun get2() = hostname + } } |
