diff --git a/app/src/main/java/com/nextcloud/talk/models/json/mention/Mention.kt b/app/src/main/java/com/nextcloud/talk/models/json/mention/Mention.kt index 470ba3c8f..93e179231 100644 --- a/app/src/main/java/com/nextcloud/talk/models/json/mention/Mention.kt +++ b/app/src/main/java/com/nextcloud/talk/models/json/mention/Mention.kt @@ -2,6 +2,8 @@ * 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 @@ -28,25 +30,19 @@ import kotlinx.android.parcel.Parcelize @JsonObject data class Mention( @JsonField(name = ["id"]) - var id: String, - + var id: String?, @JsonField(name = ["label"]) - var label: String, - + var label: String?, // type of user (guests or users or calls) @JsonField(name = ["source"]) - var source: String, - + var source: String?, @JsonField(name = ["status"]) var status: String?, - @JsonField(name = ["statusIcon"]) var statusIcon: String?, - @JsonField(name = ["statusMessage"]) var statusMessage: String? - ) : Parcelable { // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' - constructor() : this("", "", "", "", "", "") + constructor() : this(null, null, null, null, null, null) } diff --git a/app/src/main/java/com/nextcloud/talk/models/json/mention/MentionOCS.java b/app/src/main/java/com/nextcloud/talk/models/json/mention/MentionOCS.java deleted file mode 100644 index 0d0375f46..000000000 --- a/app/src/main/java/com/nextcloud/talk/models/json/mention/MentionOCS.java +++ /dev/null @@ -1,76 +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.mention; - -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 MentionOCS 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 MentionOCS)) { - return false; - } - final MentionOCS other = (MentionOCS) 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 MentionOCS; - } - - 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 "MentionOCS(data=" + this.getData() + ")"; - } -} diff --git a/app/src/main/java/com/nextcloud/talk/models/json/mention/MentionOCS.kt b/app/src/main/java/com/nextcloud/talk/models/json/mention/MentionOCS.kt new file mode 100644 index 000000000..9a6162034 --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/models/json/mention/MentionOCS.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.mention + +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 MentionOCS( + @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/mention/MentionOverall.java b/app/src/main/java/com/nextcloud/talk/models/json/mention/MentionOverall.java deleted file mode 100644 index 27e369d13..000000000 --- a/app/src/main/java/com/nextcloud/talk/models/json/mention/MentionOverall.java +++ /dev/null @@ -1,73 +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.mention; - -import com.bluelinelabs.logansquare.annotation.JsonField; -import com.bluelinelabs.logansquare.annotation.JsonObject; - -import org.parceler.Parcel; - -@Parcel -@JsonObject -public class MentionOverall { - @JsonField(name = "ocs") - MentionOCS ocs; - - public MentionOCS getOcs() { - return this.ocs; - } - - public void setOcs(MentionOCS ocs) { - this.ocs = ocs; - } - - public boolean equals(final Object o) { - if (o == this) { - return true; - } - if (!(o instanceof MentionOverall)) { - return false; - } - final MentionOverall other = (MentionOverall) 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 MentionOverall; - } - - 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 "MentionOverall(ocs=" + this.getOcs() + ")"; - } -} diff --git a/app/src/main/java/com/nextcloud/talk/models/json/mention/MentionOverall.kt b/app/src/main/java/com/nextcloud/talk/models/json/mention/MentionOverall.kt new file mode 100644 index 000000000..3f9b949a4 --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/models/json/mention/MentionOverall.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.mention + +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 MentionOverall( + @JsonField(name = ["ocs"]) + var ocs: MentionOCS? +) : Parcelable { + // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' + constructor() : this(null) +}