diff options
| -rw-r--r-- | android/src/main/kotlin/net/mullvad/mullvadvpn/model/LocationConstraint.kt | 15 | ||||
| -rw-r--r-- | mullvad-types/src/relay_constraints.rs | 2 |
2 files changed, 13 insertions, 4 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 + } } diff --git a/mullvad-types/src/relay_constraints.rs b/mullvad-types/src/relay_constraints.rs index 4b3eef491a..21691dc139 100644 --- a/mullvad-types/src/relay_constraints.rs +++ b/mullvad-types/src/relay_constraints.rs @@ -198,7 +198,7 @@ impl fmt::Display for RelayConstraints { #[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "snake_case")] -#[cfg_attr(target_os = "android", derive(IntoJava))] +#[cfg_attr(target_os = "android", derive(FromJava, IntoJava))] #[cfg_attr(target_os = "android", jnix(package = "net.mullvad.mullvadvpn.model"))] pub enum LocationConstraint { /// A country is represented by its two letter country code. |
