migrate sharee classes to kotlin data classes

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2022-05-14 16:01:46 +02:00
parent 199107857f
commit de542099dc
No known key found for this signature in database
GPG Key ID: 6CADC7E3523C308B
12 changed files with 231 additions and 503 deletions

View File

@ -1,76 +0,0 @@
/*
*
* Nextcloud Talk application
*
* @author Mario Danic
* Copyright (C) 2017 Mario Danic (mario@lovelyhq.com)
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.nextcloud.talk.models.json.sharees;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
import org.parceler.Parcel;
import java.util.List;
@Parcel
@JsonObject
public class ExactSharees {
@JsonField(name = "users")
List<Sharee> exactSharees;
public List<Sharee> getExactSharees() {
return this.exactSharees;
}
public void setExactSharees(List<Sharee> exactSharees) {
this.exactSharees = exactSharees;
}
public boolean equals(final Object o) {
if (o == this) {
return true;
}
if (!(o instanceof ExactSharees)) {
return false;
}
final ExactSharees other = (ExactSharees) o;
if (!other.canEqual((Object) this)) {
return false;
}
final Object this$exactSharees = this.getExactSharees();
final Object other$exactSharees = other.getExactSharees();
return this$exactSharees == null ? other$exactSharees == null : this$exactSharees.equals(other$exactSharees);
}
protected boolean canEqual(final Object other) {
return other instanceof ExactSharees;
}
public int hashCode() {
final int PRIME = 59;
int result = 1;
final Object $exactSharees = this.getExactSharees();
result = result * PRIME + ($exactSharees == null ? 43 : $exactSharees.hashCode());
return result;
}
public String toString() {
return "ExactSharees(exactSharees=" + this.getExactSharees() + ")";
}
}

View File

@ -0,0 +1,37 @@
/*
* Nextcloud Talk application
*
* @author Mario Danic
* @author Andy Scherzinger
* Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
* Copyright (C) 2017 Mario Danic (mario@lovelyhq.com)
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.nextcloud.talk.models.json.sharees
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 ExactSharees(
@JsonField(name = ["users"])
var exactSharees: List<Sharee>? = null
) : Parcelable {
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
constructor() : this(null)
}

View File

@ -1,110 +0,0 @@
/*
*
* Nextcloud Talk application
*
* @author Mario Danic
* Copyright (C) 2017 Mario Danic (mario@lovelyhq.com)
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.nextcloud.talk.models.json.sharees;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
import org.parceler.Parcel;
@Parcel
@JsonObject
public class Sharee {
@JsonField(name = "id")
String id;
@JsonField(name = "value")
Value value;
@JsonField(name = "label")
String label;
public String getId() {
return this.id;
}
public Value getValue() {
return this.value;
}
public String getLabel() {
return this.label;
}
public void setId(String id) {
this.id = id;
}
public void setValue(Value value) {
this.value = value;
}
public void setLabel(String label) {
this.label = label;
}
public boolean equals(final Object o) {
if (o == this) {
return true;
}
if (!(o instanceof Sharee)) {
return false;
}
final Sharee other = (Sharee) 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$value = this.getValue();
final Object other$value = other.getValue();
if (this$value == null ? other$value != null : !this$value.equals(other$value)) {
return false;
}
final Object this$label = this.getLabel();
final Object other$label = other.getLabel();
return this$label == null ? other$label == null : this$label.equals(other$label);
}
protected boolean canEqual(final Object other) {
return other instanceof Sharee;
}
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 $value = this.getValue();
result = result * PRIME + ($value == null ? 43 : $value.hashCode());
final Object $label = this.getLabel();
result = result * PRIME + ($label == null ? 43 : $label.hashCode());
return result;
}
public String toString() {
return "Sharee(id=" + this.getId() + ", value=" + this.getValue() + ", label=" + this.getLabel() + ")";
}
}

View File

@ -0,0 +1,41 @@
/*
* Nextcloud Talk application
*
* @author Mario Danic
* @author Andy Scherzinger
* Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
* Copyright (C) 2017 Mario Danic (mario@lovelyhq.com)
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.nextcloud.talk.models.json.sharees
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 Sharee(
@JsonField(name = ["id"])
var id: String? = null,
@JsonField(name = ["value"])
var value: Value? = null,
@JsonField(name = ["label"])
var label: String? = null
) : Parcelable {
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
constructor() : this(null, null)
}

View File

@ -1,75 +0,0 @@
/*
*
* Nextcloud Talk application
*
* @author Mario Danic
* Copyright (C) 2017 Mario Danic (mario@lovelyhq.com)
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.nextcloud.talk.models.json.sharees;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
import com.nextcloud.talk.models.json.generic.GenericOCS;
import org.parceler.Parcel;
@Parcel
@JsonObject
public class ShareesOCS extends GenericOCS {
@JsonField(name = "data")
SharesData data;
public SharesData getData() {
return this.data;
}
public void setData(SharesData data) {
this.data = data;
}
public boolean equals(final Object o) {
if (o == this) {
return true;
}
if (!(o instanceof ShareesOCS)) {
return false;
}
final ShareesOCS other = (ShareesOCS) 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 ShareesOCS;
}
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 "ShareesOCS(data=" + this.getData() + ")";
}
}

View File

@ -0,0 +1,40 @@
/*
* Nextcloud Talk application
*
* @author Mario Danic
* @author Andy Scherzinger
* Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
* Copyright (C) 2017 Mario Danic (mario@lovelyhq.com)
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.nextcloud.talk.models.json.sharees
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
data class ShareesOCS(
@JsonField(name = ["meta"])
var meta: GenericMeta?,
@JsonField(name = ["data"])
var data: SharesData? = null
) : Parcelable {
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
constructor() : this(null, null)
}

View File

@ -1,74 +0,0 @@
/*
*
* Nextcloud Talk application
*
* @author Mario Danic
* Copyright (C) 2017 Mario Danic (mario@lovelyhq.com)
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.nextcloud.talk.models.json.sharees;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
import org.parceler.Parcel;
@Parcel
@JsonObject
public class ShareesOverall {
@JsonField(name = "ocs")
ShareesOCS ocs;
public ShareesOCS getOcs() {
return this.ocs;
}
public void setOcs(ShareesOCS ocs) {
this.ocs = ocs;
}
public boolean equals(final Object o) {
if (o == this) {
return true;
}
if (!(o instanceof ShareesOverall)) {
return false;
}
final ShareesOverall other = (ShareesOverall) 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 ShareesOverall;
}
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 "ShareesOverall(ocs=" + this.getOcs() + ")";
}
}

View File

@ -0,0 +1,37 @@
/*
* Nextcloud Talk application
*
* @author Mario Danic
* @author Andy Scherzinger
* Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
* Copyright (C) 2017 Mario Danic (mario@lovelyhq.com)
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.nextcloud.talk.models.json.sharees
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 ShareesOverall(
@JsonField(name = ["ocs"])
var ocs: ShareesOCS? = null
) : Parcelable {
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
constructor() : this(null)
}

View File

@ -1,94 +0,0 @@
/*
*
* Nextcloud Talk application
*
* @author Mario Danic
* Copyright (C) 2017 Mario Danic (mario@lovelyhq.com)
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.nextcloud.talk.models.json.sharees;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
import org.parceler.Parcel;
import java.util.List;
@Parcel
@JsonObject
public class SharesData {
@JsonField(name = "users")
List<Sharee> users;
@JsonField(name = "exact")
ExactSharees exactUsers;
public List<Sharee> getUsers() {
return this.users;
}
public ExactSharees getExactUsers() {
return this.exactUsers;
}
public void setUsers(List<Sharee> users) {
this.users = users;
}
public void setExactUsers(ExactSharees exactUsers) {
this.exactUsers = exactUsers;
}
public boolean equals(final Object o) {
if (o == this) {
return true;
}
if (!(o instanceof SharesData)) {
return false;
}
final SharesData other = (SharesData) o;
if (!other.canEqual((Object) this)) {
return false;
}
final Object this$users = this.getUsers();
final Object other$users = other.getUsers();
if (this$users == null ? other$users != null : !this$users.equals(other$users)) {
return false;
}
final Object this$exactUsers = this.getExactUsers();
final Object other$exactUsers = other.getExactUsers();
return this$exactUsers == null ? other$exactUsers == null : this$exactUsers.equals(other$exactUsers);
}
protected boolean canEqual(final Object other) {
return other instanceof SharesData;
}
public int hashCode() {
final int PRIME = 59;
int result = 1;
final Object $users = this.getUsers();
result = result * PRIME + ($users == null ? 43 : $users.hashCode());
final Object $exactUsers = this.getExactUsers();
result = result * PRIME + ($exactUsers == null ? 43 : $exactUsers.hashCode());
return result;
}
public String toString() {
return "SharesData(users=" + this.getUsers() + ", exactUsers=" + this.getExactUsers() + ")";
}
}

View File

@ -0,0 +1,39 @@
/*
* Nextcloud Talk application
*
* @author Mario Danic
* @author Andy Scherzinger
* Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
* Copyright (C) 2017 Mario Danic (mario@lovelyhq.com)
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.nextcloud.talk.models.json.sharees
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 SharesData(
@JsonField(name = ["users"])
var users: List<Sharee>? = null,
@JsonField(name = ["exact"])
var exactUsers: ExactSharees? = null
) : Parcelable {
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
constructor() : this(null, null)
}

View File

@ -1,74 +0,0 @@
/*
*
* Nextcloud Talk application
*
* @author Mario Danic
* Copyright (C) 2017 Mario Danic (mario@lovelyhq.com)
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.nextcloud.talk.models.json.sharees;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
import org.parceler.Parcel;
@Parcel
@JsonObject
public class Value {
@JsonField(name = "shareWith")
String shareWith;
public String getShareWith() {
return this.shareWith;
}
public void setShareWith(String shareWith) {
this.shareWith = shareWith;
}
public boolean equals(final Object o) {
if (o == this) {
return true;
}
if (!(o instanceof Value)) {
return false;
}
final Value other = (Value) o;
if (!other.canEqual((Object) this)) {
return false;
}
final Object this$shareWith = this.getShareWith();
final Object other$shareWith = other.getShareWith();
return this$shareWith == null ? other$shareWith == null : this$shareWith.equals(other$shareWith);
}
protected boolean canEqual(final Object other) {
return other instanceof Value;
}
public int hashCode() {
final int PRIME = 59;
int result = 1;
final Object $shareWith = this.getShareWith();
result = result * PRIME + ($shareWith == null ? 43 : $shareWith.hashCode());
return result;
}
public String toString() {
return "Value(shareWith=" + this.getShareWith() + ")";
}
}

View File

@ -0,0 +1,37 @@
/*
* Nextcloud Talk application
*
* @author Mario Danic
* @author Andy Scherzinger
* Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
* Copyright (C) 2017 Mario Danic (mario@lovelyhq.com)
*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.nextcloud.talk.models.json.sharees
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 Value(
@JsonField(name = ["shareWith"])
var shareWith: String? = null
) : Parcelable {
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
constructor() : this(null)
}