diff --git a/app/src/main/java/com/nextcloud/talk/models/json/signaling/Signaling.java b/app/src/main/java/com/nextcloud/talk/models/json/signaling/Signaling.java deleted file mode 100644 index adfb55e12..000000000 --- a/app/src/main/java/com/nextcloud/talk/models/json/signaling/Signaling.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Nextcloud Talk application - * - * @author Mario Danic - * Copyright (C) 2017 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.signaling; - -import com.bluelinelabs.logansquare.annotation.JsonField; -import com.bluelinelabs.logansquare.annotation.JsonObject; - -/** - * Created by mdjanic on 30/10/2017. - */ - -@JsonObject -public class Signaling { - @JsonField(name = "type") - String type; - //can be NCMessageWrapper or List> - @JsonField(name = "data") - Object messageWrapper; - - public String getType() { - return this.type; - } - - public Object getMessageWrapper() { - return this.messageWrapper; - } - - public void setType(String type) { - this.type = type; - } - - public void setMessageWrapper(Object messageWrapper) { - this.messageWrapper = messageWrapper; - } - - public boolean equals(final Object o) { - if (o == this) { - return true; - } - if (!(o instanceof Signaling)) { - return false; - } - final Signaling other = (Signaling) o; - if (!other.canEqual((Object) this)) { - return false; - } - final Object this$type = this.getType(); - final Object other$type = other.getType(); - if (this$type == null ? other$type != null : !this$type.equals(other$type)) { - return false; - } - final Object this$messageWrapper = this.getMessageWrapper(); - final Object other$messageWrapper = other.getMessageWrapper(); - - return this$messageWrapper == null ? other$messageWrapper == null : this$messageWrapper.equals(other$messageWrapper); - } - - protected boolean canEqual(final Object other) { - return other instanceof Signaling; - } - - public int hashCode() { - final int PRIME = 59; - int result = 1; - final Object $type = this.getType(); - result = result * PRIME + ($type == null ? 43 : $type.hashCode()); - final Object $messageWrapper = this.getMessageWrapper(); - result = result * PRIME + ($messageWrapper == null ? 43 : $messageWrapper.hashCode()); - return result; - } - - public String toString() { - return "Signaling(type=" + this.getType() + ", messageWrapper=" + this.getMessageWrapper() + ")"; - } -} diff --git a/app/src/main/java/com/nextcloud/talk/models/json/signaling/Signaling.kt b/app/src/main/java/com/nextcloud/talk/models/json/signaling/Signaling.kt new file mode 100644 index 000000000..38c17648c --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/models/json/signaling/Signaling.kt @@ -0,0 +1,43 @@ +/* + * Nextcloud Talk application + * + * @author Mario Danic + * @author Andy Scherzinger + * Copyright (C) 2022 Andy Scherzinger + * Copyright (C) 2017 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.signaling + +import android.os.Parcelable +import com.bluelinelabs.logansquare.annotation.JsonField +import com.bluelinelabs.logansquare.annotation.JsonObject +import com.nextcloud.talk.models.json.AnyParceler +import kotlinx.android.parcel.Parcelize +import kotlinx.android.parcel.TypeParceler + +@Parcelize +@JsonObject +@TypeParceler +data class Signaling( + @JsonField(name = ["type"]) + var type: String? = null, + /** can be NCMessageWrapper or List> */ + @JsonField(name = ["data"]) + var messageWrapper: Any? = null +) : Parcelable { + // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' + constructor() : this(null, null) +} diff --git a/app/src/main/java/com/nextcloud/talk/models/json/signaling/SignalingOCS.java b/app/src/main/java/com/nextcloud/talk/models/json/signaling/SignalingOCS.java deleted file mode 100644 index c060e4bf1..000000000 --- a/app/src/main/java/com/nextcloud/talk/models/json/signaling/SignalingOCS.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Nextcloud Talk application - * - * @author Mario Danic - * Copyright (C) 2017 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.signaling; - -import com.bluelinelabs.logansquare.annotation.JsonField; -import com.bluelinelabs.logansquare.annotation.JsonObject; -import com.nextcloud.talk.models.json.generic.GenericOCS; - -import java.util.List; - -@JsonObject -public class SignalingOCS extends GenericOCS { - @JsonField(name = "data") - List signalings; - - public List getSignalings() { - return this.signalings; - } - - public void setSignalings(List signalings) { - this.signalings = signalings; - } - - public boolean equals(final Object o) { - if (o == this) { - return true; - } - if (!(o instanceof SignalingOCS)) { - return false; - } - final SignalingOCS other = (SignalingOCS) o; - if (!other.canEqual((Object) this)) { - return false; - } - final Object this$signalings = this.getSignalings(); - final Object other$signalings = other.getSignalings(); - - return this$signalings == null ? other$signalings == null : this$signalings.equals(other$signalings); - } - - protected boolean canEqual(final Object other) { - return other instanceof SignalingOCS; - } - - public int hashCode() { - final int PRIME = 59; - int result = 1; - final Object $signalings = this.getSignalings(); - result = result * PRIME + ($signalings == null ? 43 : $signalings.hashCode()); - return result; - } - - public String toString() { - return "SignalingOCS(signalings=" + this.getSignalings() + ")"; - } -} diff --git a/app/src/main/java/com/nextcloud/talk/models/json/signaling/SignalingOCS.kt b/app/src/main/java/com/nextcloud/talk/models/json/signaling/SignalingOCS.kt new file mode 100644 index 000000000..bfbec9166 --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/models/json/signaling/SignalingOCS.kt @@ -0,0 +1,40 @@ +/* + * Nextcloud Talk application + * + * @author Mario Danic + * @author Andy Scherzinger + * Copyright (C) 2022 Andy Scherzinger + * Copyright (C) 2017 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.signaling + +import android.os.Parcelable +import com.bluelinelabs.logansquare.annotation.JsonField +import com.bluelinelabs.logansquare.annotation.JsonObject +import com.nextcloud.talk.models.json.generic.GenericMeta +import kotlinx.android.parcel.Parcelize + +@Parcelize +@JsonObject +class SignalingOCS( + @JsonField(name = ["meta"]) + var meta: GenericMeta?, + @JsonField(name = ["data"]) + var signalings: List? = null +) : Parcelable { + // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' + constructor() : this(null, null) +} diff --git a/app/src/main/java/com/nextcloud/talk/models/json/signaling/SignalingOverall.java b/app/src/main/java/com/nextcloud/talk/models/json/signaling/SignalingOverall.java deleted file mode 100644 index 83a1df6c3..000000000 --- a/app/src/main/java/com/nextcloud/talk/models/json/signaling/SignalingOverall.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Nextcloud Talk application - * - * @author Mario Danic - * Copyright (C) 2017 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.signaling; - -import com.bluelinelabs.logansquare.annotation.JsonField; -import com.bluelinelabs.logansquare.annotation.JsonObject; - -@JsonObject -public class SignalingOverall { - @JsonField(name = "ocs") - SignalingOCS ocs; - - public SignalingOCS getOcs() { - return this.ocs; - } - - public void setOcs(SignalingOCS ocs) { - this.ocs = ocs; - } - - public boolean equals(final Object o) { - if (o == this) { - return true; - } - if (!(o instanceof SignalingOverall)) { - return false; - } - final SignalingOverall other = (SignalingOverall) 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 SignalingOverall; - } - - 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 "SignalingOverall(ocs=" + this.getOcs() + ")"; - } -} diff --git a/app/src/main/java/com/nextcloud/talk/models/json/signaling/SignalingOverall.kt b/app/src/main/java/com/nextcloud/talk/models/json/signaling/SignalingOverall.kt new file mode 100644 index 000000000..4d19942bc --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/models/json/signaling/SignalingOverall.kt @@ -0,0 +1,37 @@ +/* + * Nextcloud Talk application + * + * @author Mario Danic + * @author Andy Scherzinger + * Copyright (C) 2022 Andy Scherzinger + * Copyright (C) 2017 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.signaling + +import android.os.Parcelable +import com.bluelinelabs.logansquare.annotation.JsonField +import com.bluelinelabs.logansquare.annotation.JsonObject +import kotlinx.android.parcel.Parcelize + +@Parcelize +@JsonObject +class SignalingOverall( + @JsonField(name = ["ocs"]) + var ocs: SignalingOCS? = null +) : Parcelable { + // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' + constructor() : this(null) +}