From dcc0a0fdd065911575307c896211772cdea73749 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Kr=C3=BCger?= Date: Wed, 16 Feb 2022 16:55:21 +0100 Subject: [PATCH] Remove Parceler from model autocomplete MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves: #1548 Signed-off-by: Tim Krüger --- .../json/autocomplete/AutocompleteOCS.java | 77 ------------- .../json/autocomplete/AutocompleteOCS.kt | 38 ++++++ .../autocomplete/AutocompleteOverall.java | 74 ------------ .../json/autocomplete/AutocompleteOverall.kt | 37 ++++++ .../json/autocomplete/AutocompleteUser.java | 109 ------------------ .../json/autocomplete/AutocompleteUser.kt | 41 +++++++ 6 files changed, 116 insertions(+), 260 deletions(-) delete mode 100644 app/src/main/java/com/nextcloud/talk/models/json/autocomplete/AutocompleteOCS.java create mode 100644 app/src/main/java/com/nextcloud/talk/models/json/autocomplete/AutocompleteOCS.kt delete mode 100644 app/src/main/java/com/nextcloud/talk/models/json/autocomplete/AutocompleteOverall.java create mode 100644 app/src/main/java/com/nextcloud/talk/models/json/autocomplete/AutocompleteOverall.kt delete mode 100644 app/src/main/java/com/nextcloud/talk/models/json/autocomplete/AutocompleteUser.java create mode 100644 app/src/main/java/com/nextcloud/talk/models/json/autocomplete/AutocompleteUser.kt diff --git a/app/src/main/java/com/nextcloud/talk/models/json/autocomplete/AutocompleteOCS.java b/app/src/main/java/com/nextcloud/talk/models/json/autocomplete/AutocompleteOCS.java deleted file mode 100644 index c96da6c19..000000000 --- a/app/src/main/java/com/nextcloud/talk/models/json/autocomplete/AutocompleteOCS.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Nextcloud Talk application - * - * @author Mario Danic - * Copyright (C) 2017-2018 Mario Danic - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.nextcloud.talk.models.json.autocomplete; - -import com.bluelinelabs.logansquare.annotation.JsonField; -import com.bluelinelabs.logansquare.annotation.JsonObject; -import com.nextcloud.talk.models.json.generic.GenericOCS; - -import org.parceler.Parcel; - -import java.util.List; - -@Parcel -@JsonObject -public class AutocompleteOCS extends GenericOCS { - @JsonField(name = "data") - List data; - - public List getData() { - return this.data; - } - - public void setData(List data) { - this.data = data; - } - - public boolean equals(final Object o) { - if (o == this) { - return true; - } - if (!(o instanceof AutocompleteOCS)) { - return false; - } - final AutocompleteOCS other = (AutocompleteOCS) o; - if (!other.canEqual((Object) this)) { - return false; - } - final Object this$data = this.getData(); - final Object other$data = other.getData(); - - return this$data == null ? other$data == null : this$data.equals(other$data); - } - - protected boolean canEqual(final Object other) { - return other instanceof AutocompleteOCS; - } - - public int hashCode() { - final int PRIME = 59; - int result = 1; - final Object $data = this.getData(); - result = result * PRIME + ($data == null ? 43 : $data.hashCode()); - return result; - } - - public String toString() { - return "AutocompleteOCS(data=" + this.getData() + ")"; - } -} diff --git a/app/src/main/java/com/nextcloud/talk/models/json/autocomplete/AutocompleteOCS.kt b/app/src/main/java/com/nextcloud/talk/models/json/autocomplete/AutocompleteOCS.kt new file mode 100644 index 000000000..7378a147d --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/models/json/autocomplete/AutocompleteOCS.kt @@ -0,0 +1,38 @@ +/* + * Nextcloud Talk application + * + * @author Mario Danic + * @author Tim Krüger + * Copyright (C) 2022 Tim Krüger + * Copyright (C) 2017-2018 Mario Danic + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.nextcloud.talk.models.json.autocomplete + +import android.os.Parcelable +import com.bluelinelabs.logansquare.annotation.JsonField +import com.bluelinelabs.logansquare.annotation.JsonObject +import com.nextcloud.talk.models.json.generic.GenericOCS +import kotlinx.android.parcel.Parcelize + +@Parcelize +@JsonObject +data class AutocompleteOCS( + @JsonField(name = ["data"]) + var data: List? +) : GenericOCS(), Parcelable { + // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' + constructor() : this(null) +} diff --git a/app/src/main/java/com/nextcloud/talk/models/json/autocomplete/AutocompleteOverall.java b/app/src/main/java/com/nextcloud/talk/models/json/autocomplete/AutocompleteOverall.java deleted file mode 100644 index b80e12567..000000000 --- a/app/src/main/java/com/nextcloud/talk/models/json/autocomplete/AutocompleteOverall.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Nextcloud Talk application - * - * @author Mario Danic - * Copyright (C) 2017-2018 Mario Danic - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.nextcloud.talk.models.json.autocomplete; - -import com.bluelinelabs.logansquare.annotation.JsonField; -import com.bluelinelabs.logansquare.annotation.JsonObject; - -import org.parceler.Parcel; - -@Parcel -@JsonObject -public class AutocompleteOverall { - @JsonField(name = "ocs") - AutocompleteOCS ocs; - - public AutocompleteOCS getOcs() { - return this.ocs; - } - - public void setOcs(AutocompleteOCS ocs) { - this.ocs = ocs; - } - - public boolean equals(final Object o) { - if (o == this) { - return true; - } - if (!(o instanceof AutocompleteOverall)) { - return false; - } - final AutocompleteOverall other = (AutocompleteOverall) o; - if (!other.canEqual((Object) this)) { - return false; - } - final Object this$ocs = this.getOcs(); - final Object other$ocs = other.getOcs(); - - return this$ocs == null ? other$ocs == null : this$ocs.equals(other$ocs); - } - - protected boolean canEqual(final Object other) { - return other instanceof AutocompleteOverall; - } - - public int hashCode() { - final int PRIME = 59; - int result = 1; - final Object $ocs = this.getOcs(); - result = result * PRIME + ($ocs == null ? 43 : $ocs.hashCode()); - return result; - } - - public String toString() { - return "AutocompleteOverall(ocs=" + this.getOcs() + ")"; - } -} diff --git a/app/src/main/java/com/nextcloud/talk/models/json/autocomplete/AutocompleteOverall.kt b/app/src/main/java/com/nextcloud/talk/models/json/autocomplete/AutocompleteOverall.kt new file mode 100644 index 000000000..32583dff9 --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/models/json/autocomplete/AutocompleteOverall.kt @@ -0,0 +1,37 @@ +/* + * Nextcloud Talk application + * + * @author Mario Danic + * @author Tim Krüger + * Copyright (C) 2022 Tim Krüger + * Copyright (C) 2017-2018 Mario Danic + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.nextcloud.talk.models.json.autocomplete + +import android.os.Parcelable +import com.bluelinelabs.logansquare.annotation.JsonField +import com.bluelinelabs.logansquare.annotation.JsonObject +import kotlinx.android.parcel.Parcelize + +@Parcelize +@JsonObject +data class AutocompleteOverall( + @JsonField(name = ["ocs"]) + var ocs: AutocompleteOCS? +) : Parcelable { + // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' + constructor() : this(null) +} diff --git a/app/src/main/java/com/nextcloud/talk/models/json/autocomplete/AutocompleteUser.java b/app/src/main/java/com/nextcloud/talk/models/json/autocomplete/AutocompleteUser.java deleted file mode 100644 index 3d50c9fce..000000000 --- a/app/src/main/java/com/nextcloud/talk/models/json/autocomplete/AutocompleteUser.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Nextcloud Talk application - * - * @author Mario Danic - * Copyright (C) 2017-2018 Mario Danic - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.nextcloud.talk.models.json.autocomplete; - -import com.bluelinelabs.logansquare.annotation.JsonField; -import com.bluelinelabs.logansquare.annotation.JsonObject; - -import org.parceler.Parcel; - -@Parcel -@JsonObject -public class AutocompleteUser { - @JsonField(name = "id") - String id; - - @JsonField(name = "label") - String label; - - @JsonField(name = "source") - String source; - - public String getId() { - return this.id; - } - - public String getLabel() { - return this.label; - } - - public String getSource() { - return this.source; - } - - public void setId(String id) { - this.id = id; - } - - public void setLabel(String label) { - this.label = label; - } - - public void setSource(String source) { - this.source = source; - } - - public boolean equals(final Object o) { - if (o == this) { - return true; - } - if (!(o instanceof AutocompleteUser)) { - return false; - } - final AutocompleteUser other = (AutocompleteUser) o; - if (!other.canEqual((Object) this)) { - return false; - } - final Object this$id = this.getId(); - final Object other$id = other.getId(); - if (this$id == null ? other$id != null : !this$id.equals(other$id)) { - return false; - } - final Object this$label = this.getLabel(); - final Object other$label = other.getLabel(); - if (this$label == null ? other$label != null : !this$label.equals(other$label)) { - return false; - } - final Object this$source = this.getSource(); - final Object other$source = other.getSource(); - return this$source == null ? other$source == null : this$source.equals(other$source); - } - - protected boolean canEqual(final Object other) { - return other instanceof AutocompleteUser; - } - - public int hashCode() { - final int PRIME = 59; - int result = 1; - final Object $id = this.getId(); - result = result * PRIME + ($id == null ? 43 : $id.hashCode()); - final Object $label = this.getLabel(); - result = result * PRIME + ($label == null ? 43 : $label.hashCode()); - final Object $source = this.getSource(); - result = result * PRIME + ($source == null ? 43 : $source.hashCode()); - return result; - } - - public String toString() { - return "AutocompleteUser(id=" + this.getId() + ", label=" + this.getLabel() + ", source=" + this.getSource() + ")"; - } -} diff --git a/app/src/main/java/com/nextcloud/talk/models/json/autocomplete/AutocompleteUser.kt b/app/src/main/java/com/nextcloud/talk/models/json/autocomplete/AutocompleteUser.kt new file mode 100644 index 000000000..f356ad5e5 --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/models/json/autocomplete/AutocompleteUser.kt @@ -0,0 +1,41 @@ +/* + * Nextcloud Talk application + * + * @author Mario Danic + * @author Tim Krüger + * Copyright (C) 2022 Tim Krüger + * Copyright (C) 2017-2018 Mario Danic + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.nextcloud.talk.models.json.autocomplete + +import android.os.Parcelable +import com.bluelinelabs.logansquare.annotation.JsonField +import com.bluelinelabs.logansquare.annotation.JsonObject +import kotlinx.android.parcel.Parcelize + +@Parcelize +@JsonObject +data class AutocompleteUser( + @JsonField(name = ["id"]) + var id: String?, + @JsonField(name = ["label"]) + var label: String?, + @JsonField(name = ["source"]) + var source: String? +) : Parcelable { + // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' + constructor() : this(null, null, null) +}