diff --git a/android/app/build.gradle b/android/app/build.gradle index 7d3fd253ae..6cd61a4b7e 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -1,5 +1,7 @@ apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' apply plugin: 'realm-android' +apply plugin: 'kotlin-kapt' def gitSha = 'git rev-parse --short HEAD'.execute([], project.rootDir).text.trim() def buildTime = new Date().format("yyyy-MM-dd'T'HH:mm'Z'", TimeZone.getTimeZone("UTC")) @@ -144,4 +146,8 @@ dependencies { //Zoomable image view compile 'com.github.chrisbanes:PhotoView:2.1.3' + compile "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" +} +repositories { + mavenCentral() } diff --git a/android/app/src/main/java/org/fossasia/openevent/common/utils/SortOrder.java b/android/app/src/main/java/org/fossasia/openevent/common/utils/SortOrder.java index 333c028ea9..3e0d871266 100644 --- a/android/app/src/main/java/org/fossasia/openevent/common/utils/SortOrder.java +++ b/android/app/src/main/java/org/fossasia/openevent/common/utils/SortOrder.java @@ -20,15 +20,15 @@ public static String sortOrderSpeaker() { switch (SharedPreferencesUtil.getInt(ConstantStrings.PREF_SORT_SPEAKER, 0)) { case SORT_TYPE_FIRST: //By NAME - return Speaker.NAME; + return Speaker.Companion.getNAME(); case SORT_TYPE_SECOND: //By ORGANISATION - return Speaker.ORGANISATION; + return Speaker.Companion.getORGANISATION(); case SORT_TYPE_THIRD: //By COUNTRY - return Speaker.COUNTRY; + return Speaker.Companion.getCOUNTRY(); default: - return Speaker.NAME; + return Speaker.Companion.getNAME(); } } @@ -36,15 +36,15 @@ public static String sortTypeSchedule() { switch (SharedPreferencesUtil.getInt(ConstantStrings.PREF_SORT_SCHEDULE, 2)) { case SORT_TYPE_FIRST: //By TITLE - return Session.TITLE; + return Session.Companion.getTITLE(); case SORT_TYPE_SECOND: //By TRACKS - return Session.TRACK; + return Session.Companion.getTRACK(); case SORT_TYPE_THIRD: //By START_TIME - return Session.START_TIME; + return Session.Companion.getSTART_TIME(); default: - return Session.START_TIME; + return Session.Companion.getSTART_TIME(); } } diff --git a/android/app/src/main/java/org/fossasia/openevent/core/auth/ChangePasswordActivityViewModel.java b/android/app/src/main/java/org/fossasia/openevent/core/auth/ChangePasswordActivityViewModel.java index fc9146e4b5..7a831233c2 100644 --- a/android/app/src/main/java/org/fossasia/openevent/core/auth/ChangePasswordActivityViewModel.java +++ b/android/app/src/main/java/org/fossasia/openevent/core/auth/ChangePasswordActivityViewModel.java @@ -75,7 +75,7 @@ public LiveData changePassword(String newPassword) { int id; try { id = JWTUtils.getIdentity(AuthUtil.getAuthorization()); - compositeDisposable.add(APIClient.getOpenEventAPI().updateUser(User.builder().id(id).password(newPassword).build(), id) + compositeDisposable.add(APIClient.getOpenEventAPI().updateUser(User.Companion.builder().id(id).password(newPassword).build(), id) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .flatMapCompletable(user -> RealmDataRepository diff --git a/android/app/src/main/java/org/fossasia/openevent/core/auth/SignUpActivityViewModel.java b/android/app/src/main/java/org/fossasia/openevent/core/auth/SignUpActivityViewModel.java index 88b66a2fb1..05d2d5d606 100644 --- a/android/app/src/main/java/org/fossasia/openevent/core/auth/SignUpActivityViewModel.java +++ b/android/app/src/main/java/org/fossasia/openevent/core/auth/SignUpActivityViewModel.java @@ -36,7 +36,7 @@ public LiveData signUpUser(String email, String password) { if (signUpResponse == null) { signUpResponse = new MutableLiveData<>(); } - compositeDisposable.add(APIClient.getOpenEventAPI().signUp(User.builder().email(email).password(password).build()) + compositeDisposable.add(APIClient.getOpenEventAPI().signUp(User.Companion.builder().email(email).password(password).build()) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(user -> { diff --git a/android/app/src/main/java/org/fossasia/openevent/core/auth/model/ImageResponse.java b/android/app/src/main/java/org/fossasia/openevent/core/auth/model/ImageResponse.java deleted file mode 100644 index 28543ccf80..0000000000 --- a/android/app/src/main/java/org/fossasia/openevent/core/auth/model/ImageResponse.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.fossasia.openevent.core.auth.model; - -public class ImageResponse { - private String url; - - public ImageResponse(String url) { - this.url = url; - } - - public ImageResponse() { - } - - public String getUrl() { - return this.url; - } - - public void setUrl(String url) { - this.url = url; - } - - public boolean equals(Object o) { - if (o == this) return true; - if (!(o instanceof ImageResponse)) return false; - final ImageResponse other = (ImageResponse) o; - if (!other.canEqual((Object) this)) return false; - final Object this$url = this.getUrl(); - final Object other$url = other.getUrl(); - if (this$url == null ? other$url != null : !this$url.equals(other$url)) return false; - return true; - } - - public int hashCode() { - final int PRIME = 59; - int result = 1; - final Object $url = this.getUrl(); - result = result * PRIME + ($url == null ? 43 : $url.hashCode()); - return result; - } - - protected boolean canEqual(Object other) { - return other instanceof ImageResponse; - } - - public String toString() { - return "ImageResponse(url=" + this.getUrl() + ")"; - } -} diff --git a/android/app/src/main/java/org/fossasia/openevent/core/auth/model/ImageResponse.kt b/android/app/src/main/java/org/fossasia/openevent/core/auth/model/ImageResponse.kt new file mode 100644 index 0000000000..2ccc9dd952 --- /dev/null +++ b/android/app/src/main/java/org/fossasia/openevent/core/auth/model/ImageResponse.kt @@ -0,0 +1,3 @@ +package org.fossasia.openevent.core.auth.model + +data class ImageResponse ( var url: String ) diff --git a/android/app/src/main/java/org/fossasia/openevent/core/auth/model/Login.java b/android/app/src/main/java/org/fossasia/openevent/core/auth/model/Login.java deleted file mode 100644 index 64238ba813..0000000000 --- a/android/app/src/main/java/org/fossasia/openevent/core/auth/model/Login.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.fossasia.openevent.core.auth.model; - -public class Login { - private String email; - private String password; - - public Login(String email, String password) { - this.email = email; - this.password = password; - } - - public String getEmail() { - return this.email; - } - - public String getPassword() { - return this.password; - } - - public void setEmail(String email) { - this.email = email; - } - - public void setPassword(String password) { - this.password = password; - } - - public boolean equals(Object o) { - if (o == this) return true; - if (!(o instanceof Login)) return false; - final Login other = (Login) o; - if (!other.canEqual((Object) this)) return false; - final Object this$email = this.getEmail(); - final Object other$email = other.getEmail(); - if (this$email == null ? other$email != null : !this$email.equals(other$email)) - return false; - final Object this$password = this.getPassword(); - final Object other$password = other.getPassword(); - if (this$password == null ? other$password != null : !this$password.equals(other$password)) - return false; - return true; - } - - public int hashCode() { - final int PRIME = 59; - int result = 1; - final Object $email = this.getEmail(); - result = result * PRIME + ($email == null ? 43 : $email.hashCode()); - final Object $password = this.getPassword(); - result = result * PRIME + ($password == null ? 43 : $password.hashCode()); - return result; - } - - protected boolean canEqual(Object other) { - return other instanceof Login; - } - - public String toString() { - return "Login(email=" + this.getEmail() + ", password=" + this.getPassword() + ")"; - } -} \ No newline at end of file diff --git a/android/app/src/main/java/org/fossasia/openevent/core/auth/model/Login.kt b/android/app/src/main/java/org/fossasia/openevent/core/auth/model/Login.kt new file mode 100644 index 0000000000..39969603f7 --- /dev/null +++ b/android/app/src/main/java/org/fossasia/openevent/core/auth/model/Login.kt @@ -0,0 +1,3 @@ +package org.fossasia.openevent.core.auth.model + +data class Login(var email: String?, var password: String?) \ No newline at end of file diff --git a/android/app/src/main/java/org/fossasia/openevent/core/auth/model/LoginResponse.java b/android/app/src/main/java/org/fossasia/openevent/core/auth/model/LoginResponse.java deleted file mode 100644 index c7093b342b..0000000000 --- a/android/app/src/main/java/org/fossasia/openevent/core/auth/model/LoginResponse.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.fossasia.openevent.core.auth.model; - -import com.fasterxml.jackson.databind.PropertyNamingStrategy; -import com.fasterxml.jackson.databind.annotation.JsonNaming; - -@JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class) -public class LoginResponse { - private String accessToken; - - public LoginResponse(String accessToken) { - this.accessToken = accessToken; - } - - public LoginResponse() { - } - - public String getAccessToken() { - return this.accessToken; - } - - public void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - - public boolean equals(Object o) { - if (o == this) return true; - if (!(o instanceof LoginResponse)) return false; - final LoginResponse other = (LoginResponse) o; - if (!other.canEqual((Object) this)) return false; - final Object this$accessToken = this.getAccessToken(); - final Object other$accessToken = other.getAccessToken(); - if (this$accessToken == null ? other$accessToken != null : !this$accessToken.equals(other$accessToken)) - return false; - return true; - } - - public int hashCode() { - final int PRIME = 59; - int result = 1; - final Object $accessToken = this.getAccessToken(); - result = result * PRIME + ($accessToken == null ? 43 : $accessToken.hashCode()); - return result; - } - - protected boolean canEqual(Object other) { - return other instanceof LoginResponse; - } - - public String toString() { - return "LoginResponse(accessToken=" + this.getAccessToken() + ")"; - } -} \ No newline at end of file diff --git a/android/app/src/main/java/org/fossasia/openevent/core/auth/model/LoginResponse.kt b/android/app/src/main/java/org/fossasia/openevent/core/auth/model/LoginResponse.kt new file mode 100644 index 0000000000..c66aedc4c0 --- /dev/null +++ b/android/app/src/main/java/org/fossasia/openevent/core/auth/model/LoginResponse.kt @@ -0,0 +1,7 @@ +package org.fossasia.openevent.core.auth.model + +import com.fasterxml.jackson.databind.PropertyNamingStrategy +import com.fasterxml.jackson.databind.annotation.JsonNaming + +@JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy::class) +data class LoginResponse ( var accessToken: String? = null ) \ No newline at end of file diff --git a/android/app/src/main/java/org/fossasia/openevent/core/auth/model/UploadImage.java b/android/app/src/main/java/org/fossasia/openevent/core/auth/model/UploadImage.java deleted file mode 100644 index f7c80d8aa2..0000000000 --- a/android/app/src/main/java/org/fossasia/openevent/core/auth/model/UploadImage.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.fossasia.openevent.core.auth.model; - -public class UploadImage { - private String data; - - public UploadImage(String data) { - this.data = data; - } - - public String getData() { - return this.data; - } - - public void setData(String data) { - this.data = data; - } - - public boolean equals(Object o) { - if (o == this) return true; - if (!(o instanceof UploadImage)) return false; - final UploadImage other = (UploadImage) o; - if (!other.canEqual((Object) this)) return false; - final Object this$data = this.getData(); - final Object other$data = other.getData(); - if (this$data == null ? other$data != null : !this$data.equals(other$data)) return false; - return true; - } - - 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; - } - - protected boolean canEqual(Object other) { - return other instanceof UploadImage; - } - - public String toString() { - return "UploadImage(data=" + this.getData() + ")"; - } -} diff --git a/android/app/src/main/java/org/fossasia/openevent/core/auth/model/UploadImage.kt b/android/app/src/main/java/org/fossasia/openevent/core/auth/model/UploadImage.kt new file mode 100644 index 0000000000..b588a5e7fc --- /dev/null +++ b/android/app/src/main/java/org/fossasia/openevent/core/auth/model/UploadImage.kt @@ -0,0 +1,3 @@ +package org.fossasia.openevent.core.auth.model + +data class UploadImage(var data: String?) diff --git a/android/app/src/main/java/org/fossasia/openevent/core/auth/model/User.java b/android/app/src/main/java/org/fossasia/openevent/core/auth/model/User.java deleted file mode 100644 index 8eb21c3af1..0000000000 --- a/android/app/src/main/java/org/fossasia/openevent/core/auth/model/User.java +++ /dev/null @@ -1,428 +0,0 @@ -package org.fossasia.openevent.core.auth.model; - -import com.fasterxml.jackson.databind.PropertyNamingStrategy; -import com.fasterxml.jackson.databind.annotation.JsonNaming; -import com.github.jasminb.jsonapi.IntegerIdHandler; -import com.github.jasminb.jsonapi.annotations.Id; -import com.github.jasminb.jsonapi.annotations.Type; - -import io.realm.RealmObject; -import io.realm.annotations.Ignore; -import io.realm.annotations.PrimaryKey; - -@Type("user") -@JsonNaming(PropertyNamingStrategy.KebabCaseStrategy.class) -public class User extends RealmObject { - - @PrimaryKey - @Id(IntegerIdHandler.class) - private int id; - private String firstName; - private String lastName; - private String email; - @Ignore - private String password; - private boolean isAdmin; - private boolean isSuperAdmin; - private String createdAt; - private String lastAccessedAt; - private String contact; - private String deletedAt; - private String details; - private boolean isVerified; - private String thumbnailImageUrl; - private String iconImageUrl; - private String smallImageUrl; - private String avatarUrl; - private String facebookUrl; - private String twitterUrl; - private String instagramUrl; - private String googlePlusUrl; - private String originalImageUrl; - - public User(int id, String firstName, String lastName, String email, String password, boolean isAdmin, boolean isSuperAdmin, String createdAt, String lastAccessedAt, String contact, String deletedAt, String details, boolean isVerified, String thumbnailImageUrl, String iconImageUrl, String smallImageUrl, String avatarUrl, String facebookUrl, String twitterUrl, String instagramUrl, String googlePlusUrl, String originalImageUrl) { - this.id = id; - this.firstName = firstName; - this.lastName = lastName; - this.email = email; - this.password = password; - this.isAdmin = isAdmin; - this.isSuperAdmin = isSuperAdmin; - this.createdAt = createdAt; - this.lastAccessedAt = lastAccessedAt; - this.contact = contact; - this.deletedAt = deletedAt; - this.details = details; - this.isVerified = isVerified; - this.thumbnailImageUrl = thumbnailImageUrl; - this.iconImageUrl = iconImageUrl; - this.smallImageUrl = smallImageUrl; - this.avatarUrl = avatarUrl; - this.facebookUrl = facebookUrl; - this.twitterUrl = twitterUrl; - this.instagramUrl = instagramUrl; - this.googlePlusUrl = googlePlusUrl; - this.originalImageUrl = originalImageUrl; - } - - public User() { - } - - public static UserBuilder builder() { - return new UserBuilder(); - } - - public int getId() { - return this.id; - } - - public String getFirstName() { - return this.firstName; - } - - public String getLastName() { - return this.lastName; - } - - public String getEmail() { - return this.email; - } - - public String getPassword() { - return this.password; - } - - public boolean getIsAdmin() { - return this.isAdmin; - } - - public boolean getIsSuperAdmin() { - return this.isSuperAdmin; - } - - public String getCreatedAt() { - return this.createdAt; - } - - public String getLastAccessedAt() { - return this.lastAccessedAt; - } - - public String getContact() { - return this.contact; - } - - public String getDeletedAt() { - return this.deletedAt; - } - - public String getDetails() { - return this.details; - } - - public boolean getIsVerified() { - return this.isVerified; - } - - public String getThumbnailImageUrl() { - return this.thumbnailImageUrl; - } - - public String getIconImageUrl() { - return this.iconImageUrl; - } - - public String getSmallImageUrl() { - return this.smallImageUrl; - } - - public String getAvatarUrl() { - return this.avatarUrl; - } - - public String getFacebookUrl() { - return this.facebookUrl; - } - - public String getTwitterUrl() { - return this.twitterUrl; - } - - public String getInstagramUrl() { - return this.instagramUrl; - } - - public String getGooglePlusUrl() { - return this.googlePlusUrl; - } - - public String getOriginalImageUrl() { - return this.originalImageUrl; - } - - public void setId(int id) { - this.id = id; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public void setEmail(String email) { - this.email = email; - } - - public void setPassword(String password) { - this.password = password; - } - - public void setIsAdmin(boolean isAdmin) { - this.isAdmin = isAdmin; - } - - public void setIsSuperAdmin(boolean isSuperAdmin) { - this.isSuperAdmin = isSuperAdmin; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public void setLastAccessedAt(String lastAccessedAt) { - this.lastAccessedAt = lastAccessedAt; - } - - public void setContact(String contact) { - this.contact = contact; - } - - public void setDeletedAt(String deletedAt) { - this.deletedAt = deletedAt; - } - - public void setDetails(String details) { - this.details = details; - } - - public void setIsVerified(boolean isVerified) { - this.isVerified = isVerified; - } - - public void setThumbnailImageUrl(String thumbnailImageUrl) { - this.thumbnailImageUrl = thumbnailImageUrl; - } - - public void setIconImageUrl(String iconImageUrl) { - this.iconImageUrl = iconImageUrl; - } - - public void setSmallImageUrl(String smallImageUrl) { - this.smallImageUrl = smallImageUrl; - } - - public void setAvatarUrl(String avatarUrl) { - this.avatarUrl = avatarUrl; - } - - public void setFacebookUrl(String facebookUrl) { - this.facebookUrl = facebookUrl; - } - - public void setTwitterUrl(String twitterUrl) { - this.twitterUrl = twitterUrl; - } - - public void setInstagramUrl(String instagramUrl) { - this.instagramUrl = instagramUrl; - } - - public void setGooglePlusUrl(String googlePlusUrl) { - this.googlePlusUrl = googlePlusUrl; - } - - public void setOriginalImageUrl(String originalImageUrl) { - this.originalImageUrl = originalImageUrl; - } - - public String toString() { - return "User(id=" + this.getId() + ", firstName=" + this.getFirstName() + ", lastName=" + this.getLastName() + ", email=" + this.getEmail() + ", password=" + this.getPassword() + ", isAdmin=" + this.getIsAdmin() + ", isSuperAdmin=" + this.getIsSuperAdmin() + ", createdAt=" + this.getCreatedAt() + ", lastAccessedAt=" + this.getLastAccessedAt() + ", contact=" + this.getContact() + ", deletedAt=" + this.getDeletedAt() + ", details=" + this.getDetails() + ", isVerified=" + this.getIsVerified() + ", thumbnailImageUrl=" + this.getThumbnailImageUrl() + ", iconImageUrl=" + this.getIconImageUrl() + ", smallImageUrl=" + this.getSmallImageUrl() + ", avatarUrl=" + this.getAvatarUrl() + ", facebookUrl=" + this.getFacebookUrl() + ", twitterUrl=" + this.getTwitterUrl() + ", instagramUrl=" + this.getInstagramUrl() + ", googlePlusUrl=" + this.getGooglePlusUrl() + ", originalImageUrl=" + this.getOriginalImageUrl() + ")"; - } - - public boolean equals(Object o) { - if (o == this) return true; - if (!(o instanceof User)) return false; - final User other = (User) o; - if (!other.canEqual((Object) this)) return false; - if (!super.equals(o)) return false; - if (this.getId() != other.getId()) return false; - final Object this$email = this.getEmail(); - final Object other$email = other.getEmail(); - if (this$email == null ? other$email != null : !this$email.equals(other$email)) - return false; - return true; - } - - public int hashCode() { - final int PRIME = 59; - int result = 1; - result = result * PRIME + super.hashCode(); - result = result * PRIME + this.getId(); - final Object $email = this.getEmail(); - result = result * PRIME + ($email == null ? 43 : $email.hashCode()); - return result; - } - - protected boolean canEqual(Object other) { - return other instanceof User; - } - - public static class UserBuilder { - private int id; - private String firstName; - private String lastName; - private String email; - private String password; - private boolean isAdmin; - private boolean isSuperAdmin; - private String createdAt; - private String lastAccessedAt; - private String contact; - private String deletedAt; - private String details; - private boolean isVerified; - private String thumbnailImageUrl; - private String iconImageUrl; - private String smallImageUrl; - private String avatarUrl; - private String facebookUrl; - private String twitterUrl; - private String instagramUrl; - private String googlePlusUrl; - private String originalImageUrl; - - UserBuilder() { - } - - public User.UserBuilder id(int id) { - this.id = id; - return this; - } - - public User.UserBuilder firstName(String firstName) { - this.firstName = firstName; - return this; - } - - public User.UserBuilder lastName(String lastName) { - this.lastName = lastName; - return this; - } - - public User.UserBuilder email(String email) { - this.email = email; - return this; - } - - public User.UserBuilder password(String password) { - this.password = password; - return this; - } - - public User.UserBuilder isAdmin(boolean isAdmin) { - this.isAdmin = isAdmin; - return this; - } - - public User.UserBuilder isSuperAdmin(boolean isSuperAdmin) { - this.isSuperAdmin = isSuperAdmin; - return this; - } - - public User.UserBuilder createdAt(String createdAt) { - this.createdAt = createdAt; - return this; - } - - public User.UserBuilder lastAccessedAt(String lastAccessedAt) { - this.lastAccessedAt = lastAccessedAt; - return this; - } - - public User.UserBuilder contact(String contact) { - this.contact = contact; - return this; - } - - public User.UserBuilder deletedAt(String deletedAt) { - this.deletedAt = deletedAt; - return this; - } - - public User.UserBuilder details(String details) { - this.details = details; - return this; - } - - public User.UserBuilder isVerified(boolean isVerified) { - this.isVerified = isVerified; - return this; - } - - public User.UserBuilder thumbnailImageUrl(String thumbnailImageUrl) { - this.thumbnailImageUrl = thumbnailImageUrl; - return this; - } - - public User.UserBuilder iconImageUrl(String iconImageUrl) { - this.iconImageUrl = iconImageUrl; - return this; - } - - public User.UserBuilder smallImageUrl(String smallImageUrl) { - this.smallImageUrl = smallImageUrl; - return this; - } - - public User.UserBuilder avatarUrl(String avatarUrl) { - this.avatarUrl = avatarUrl; - return this; - } - - public User.UserBuilder facebookUrl(String facebookUrl) { - this.facebookUrl = facebookUrl; - return this; - } - - public User.UserBuilder twitterUrl(String twitterUrl) { - this.twitterUrl = twitterUrl; - return this; - } - - public User.UserBuilder instagramUrl(String instagramUrl) { - this.instagramUrl = instagramUrl; - return this; - } - - public User.UserBuilder googlePlusUrl(String googlePlusUrl) { - this.googlePlusUrl = googlePlusUrl; - return this; - } - - public User.UserBuilder originalImageUrl(String originalImageUrl) { - this.originalImageUrl = originalImageUrl; - return this; - } - - public User build() { - return new User(id, firstName, lastName, email, password, isAdmin, isSuperAdmin, createdAt, lastAccessedAt, contact, deletedAt, details, isVerified, thumbnailImageUrl, iconImageUrl, smallImageUrl, avatarUrl, facebookUrl, twitterUrl, instagramUrl, googlePlusUrl, originalImageUrl); - } - - public String toString() { - return "User.UserBuilder(id=" + this.id + ", firstName=" + this.firstName + ", lastName=" + this.lastName + ", email=" + this.email + ", password=" + this.password + ", isAdmin=" + this.isAdmin + ", isSuperAdmin=" + this.isSuperAdmin + ", createdAt=" + this.createdAt + ", lastAccessedAt=" + this.lastAccessedAt + ", contact=" + this.contact + ", deletedAt=" + this.deletedAt + ", details=" + this.details + ", isVerified=" + this.isVerified + ", thumbnailImageUrl=" + this.thumbnailImageUrl + ", iconImageUrl=" + this.iconImageUrl + ", smallImageUrl=" + this.smallImageUrl + ", avatarUrl=" + this.avatarUrl + ", facebookUrl=" + this.facebookUrl + ", twitterUrl=" + this.twitterUrl + ", instagramUrl=" + this.instagramUrl + ", googlePlusUrl=" + this.googlePlusUrl + ", originalImageUrl=" + this.originalImageUrl + ")"; - } - } -} diff --git a/android/app/src/main/java/org/fossasia/openevent/core/auth/model/User.kt b/android/app/src/main/java/org/fossasia/openevent/core/auth/model/User.kt new file mode 100644 index 0000000000..0d2a50de6f --- /dev/null +++ b/android/app/src/main/java/org/fossasia/openevent/core/auth/model/User.kt @@ -0,0 +1,189 @@ +package org.fossasia.openevent.core.auth.model + +import com.fasterxml.jackson.databind.PropertyNamingStrategy +import com.fasterxml.jackson.databind.annotation.JsonNaming +import com.github.jasminb.jsonapi.IntegerIdHandler +import com.github.jasminb.jsonapi.annotations.Id +import com.github.jasminb.jsonapi.annotations.Type + +import io.realm.RealmObject +import io.realm.annotations.Ignore +import io.realm.annotations.PrimaryKey + +@Type("user") +@JsonNaming(PropertyNamingStrategy.KebabCaseStrategy::class) +open class User( + @PrimaryKey + @Id(IntegerIdHandler::class) + var id: Int = 0, + var firstName: String? = null, + var lastName: String? = null, + var email: String? = null, + @Ignore + var password: String? = null, + var isAdmin: Boolean = false, + var isSuperAdmin: Boolean = false, + var createdAt: String? = null, + var lastAccessedAt: String? = null, + var contact: String? = null, + var deletedAt: String? = null, + var details: String? = null, + var isVerified: Boolean = false, + var thumbnailImageUrl: String? = null, + var iconImageUrl: String? = null, + var smallImageUrl: String? = null, + var avatarUrl: String? = null, + var facebookUrl: String? = null, + var twitterUrl: String? = null, + var instagramUrl: String? = null, + var googlePlusUrl: String? = null, + var originalImageUrl: String? = null +) : RealmObject() { + + class UserBuilder internal constructor() { + private var id: Int = 0 + private var firstName: String? = null + private var lastName: String? = null + private var email: String? = null + private var password: String? = null + private var isAdmin: Boolean = false + private var isSuperAdmin: Boolean = false + private var createdAt: String? = null + private var lastAccessedAt: String? = null + private var contact: String? = null + private var deletedAt: String? = null + private var details: String? = null + private var isVerified: Boolean = false + private var thumbnailImageUrl: String? = null + private var iconImageUrl: String? = null + private var smallImageUrl: String? = null + private var avatarUrl: String? = null + private var facebookUrl: String? = null + private var twitterUrl: String? = null + private var instagramUrl: String? = null + private var googlePlusUrl: String? = null + private var originalImageUrl: String? = null + + fun id(id: Int): User.UserBuilder { + this.id = id + return this + } + + fun firstName(firstName: String): User.UserBuilder { + this.firstName = firstName + return this + } + + fun lastName(lastName: String): User.UserBuilder { + this.lastName = lastName + return this + } + + fun email(email: String): User.UserBuilder { + this.email = email + return this + } + + fun password(password: String): User.UserBuilder { + this.password = password + return this + } + + fun isAdmin(isAdmin: Boolean): User.UserBuilder { + this.isAdmin = isAdmin + return this + } + + fun isSuperAdmin(isSuperAdmin: Boolean): User.UserBuilder { + this.isSuperAdmin = isSuperAdmin + return this + } + + fun createdAt(createdAt: String): User.UserBuilder { + this.createdAt = createdAt + return this + } + + fun lastAccessedAt(lastAccessedAt: String): User.UserBuilder { + this.lastAccessedAt = lastAccessedAt + return this + } + + fun contact(contact: String): User.UserBuilder { + this.contact = contact + return this + } + + fun deletedAt(deletedAt: String): User.UserBuilder { + this.deletedAt = deletedAt + return this + } + + fun details(details: String): User.UserBuilder { + this.details = details + return this + } + + fun isVerified(isVerified: Boolean): User.UserBuilder { + this.isVerified = isVerified + return this + } + + fun thumbnailImageUrl(thumbnailImageUrl: String): User.UserBuilder { + this.thumbnailImageUrl = thumbnailImageUrl + return this + } + + fun iconImageUrl(iconImageUrl: String): User.UserBuilder { + this.iconImageUrl = iconImageUrl + return this + } + + fun smallImageUrl(smallImageUrl: String): User.UserBuilder { + this.smallImageUrl = smallImageUrl + return this + } + + fun avatarUrl(avatarUrl: String): User.UserBuilder { + this.avatarUrl = avatarUrl + return this + } + + fun facebookUrl(facebookUrl: String): User.UserBuilder { + this.facebookUrl = facebookUrl + return this + } + + fun twitterUrl(twitterUrl: String): User.UserBuilder { + this.twitterUrl = twitterUrl + return this + } + + fun instagramUrl(instagramUrl: String): User.UserBuilder { + this.instagramUrl = instagramUrl + return this + } + + fun googlePlusUrl(googlePlusUrl: String): User.UserBuilder { + this.googlePlusUrl = googlePlusUrl + return this + } + + fun originalImageUrl(originalImageUrl: String): User.UserBuilder { + this.originalImageUrl = originalImageUrl + return this + } + + fun build(): User { + return User(id, firstName, lastName, email, password, isAdmin, isSuperAdmin, createdAt, lastAccessedAt, contact, deletedAt, details, isVerified, thumbnailImageUrl, iconImageUrl, smallImageUrl, avatarUrl, facebookUrl, twitterUrl, instagramUrl, googlePlusUrl, originalImageUrl) + } + + } + + companion object { + + fun builder(): UserBuilder { + return UserBuilder() + } + } +} diff --git a/android/app/src/main/java/org/fossasia/openevent/core/auth/profile/EditProfileActivityViewModel.java b/android/app/src/main/java/org/fossasia/openevent/core/auth/profile/EditProfileActivityViewModel.java index 2bf821b8b8..bd20867466 100644 --- a/android/app/src/main/java/org/fossasia/openevent/core/auth/profile/EditProfileActivityViewModel.java +++ b/android/app/src/main/java/org/fossasia/openevent/core/auth/profile/EditProfileActivityViewModel.java @@ -80,7 +80,7 @@ public LiveData updateUser (String firstName, String lastName, String a return userUpdateResponse; } - User.UserBuilder builder = User.builder(); + User.UserBuilder builder = User.Companion.builder(); builder.id(id).firstName(firstName).lastName(lastName); if (!Utils.isEmpty(uploadedImageUrl)) diff --git a/android/app/src/main/java/org/fossasia/openevent/core/feed/facebook/api/CommentItem.java b/android/app/src/main/java/org/fossasia/openevent/core/feed/facebook/api/CommentItem.java deleted file mode 100644 index be94823f33..0000000000 --- a/android/app/src/main/java/org/fossasia/openevent/core/feed/facebook/api/CommentItem.java +++ /dev/null @@ -1,127 +0,0 @@ -package org.fossasia.openevent.core.feed.facebook.api; - -import android.os.Parcel; -import android.os.Parcelable; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.databind.PropertyNamingStrategy; -import com.fasterxml.jackson.databind.annotation.JsonNaming; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class) -public class CommentItem implements Parcelable { - - private String createdTime; - private Commenter from; - private String message; - private String id; - - protected CommentItem(Parcel in) { - createdTime = in.readString(); - message = in.readString(); - id = in.readString(); - } - - public static final Creator CREATOR = new Creator() { - @Override - public CommentItem createFromParcel(Parcel in) { - return new CommentItem(in); - } - - @Override - public CommentItem[] newArray(int size) { - return new CommentItem[size]; - } - }; - - public CommentItem() { - } - - @Override - public int describeContents() { - return 0; - } - - @Override - public void writeToParcel(Parcel dest, int flags) { - dest.writeString(createdTime); - dest.writeString(message); - dest.writeString(id); - } - - public String getCreatedTime() { - return this.createdTime; - } - - public Commenter getFrom() { - return this.from; - } - - public String getMessage() { - return this.message; - } - - public String getId() { - return this.id; - } - - public void setCreatedTime(String createdTime) { - this.createdTime = createdTime; - } - - public void setFrom(Commenter from) { - this.from = from; - } - - public void setMessage(String message) { - this.message = message; - } - - public void setId(String id) { - this.id = id; - } - - public boolean equals(Object o) { - if (o == this) return true; - if (!(o instanceof CommentItem)) return false; - final CommentItem other = (CommentItem) o; - if (!other.canEqual((Object) this)) return false; - final Object this$createdTime = this.getCreatedTime(); - final Object other$createdTime = other.getCreatedTime(); - if (this$createdTime == null ? other$createdTime != null : !this$createdTime.equals(other$createdTime)) - return false; - final Object this$from = this.getFrom(); - final Object other$from = other.getFrom(); - if (this$from == null ? other$from != null : !this$from.equals(other$from)) return false; - final Object this$message = this.getMessage(); - final Object other$message = other.getMessage(); - if (this$message == null ? other$message != null : !this$message.equals(other$message)) - 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; - return true; - } - - public int hashCode() { - final int PRIME = 59; - int result = 1; - final Object $createdTime = this.getCreatedTime(); - result = result * PRIME + ($createdTime == null ? 43 : $createdTime.hashCode()); - final Object $from = this.getFrom(); - result = result * PRIME + ($from == null ? 43 : $from.hashCode()); - final Object $message = this.getMessage(); - result = result * PRIME + ($message == null ? 43 : $message.hashCode()); - final Object $id = this.getId(); - result = result * PRIME + ($id == null ? 43 : $id.hashCode()); - return result; - } - - protected boolean canEqual(Object other) { - return other instanceof CommentItem; - } - - public String toString() { - return "CommentItem(createdTime=" + this.getCreatedTime() + ", from=" + this.getFrom() + ", message=" + this.getMessage() + ", id=" + this.getId() + ")"; - } -} \ No newline at end of file diff --git a/android/app/src/main/java/org/fossasia/openevent/core/feed/facebook/api/CommentItem.kt b/android/app/src/main/java/org/fossasia/openevent/core/feed/facebook/api/CommentItem.kt new file mode 100644 index 0000000000..28c19e7e9e --- /dev/null +++ b/android/app/src/main/java/org/fossasia/openevent/core/feed/facebook/api/CommentItem.kt @@ -0,0 +1,40 @@ +package org.fossasia.openevent.core.feed.facebook.api + +import android.os.Parcel +import android.os.Parcelable + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties +import com.fasterxml.jackson.databind.PropertyNamingStrategy +import com.fasterxml.jackson.databind.annotation.JsonNaming + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy::class) +data class CommentItem( + val createdTime: String? = null, + val from: Commenter? = null, + val message: String? = null, + val id: String? = null +) : Parcelable { + + constructor(source: Parcel) : this( + createdTime = source.readString(), + message = source.readString(), + id = source.readString() + ) + + override fun describeContents() = 0 + + override fun writeToParcel(dest: Parcel, flags: Int) = with(dest) { + writeString(createdTime) + writeString(message) + writeString(id) + } + + companion object { + @JvmField + val CREATOR: Parcelable.Creator = object : Parcelable.Creator { + override fun createFromParcel(source: Parcel): CommentItem = CommentItem(source) + override fun newArray(size: Int): Array = arrayOfNulls(size) + } + } +} \ No newline at end of file diff --git a/android/app/src/main/java/org/fossasia/openevent/core/feed/facebook/api/Commenter.java b/android/app/src/main/java/org/fossasia/openevent/core/feed/facebook/api/Commenter.java deleted file mode 100644 index 4606eca4f6..0000000000 --- a/android/app/src/main/java/org/fossasia/openevent/core/feed/facebook/api/Commenter.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.fossasia.openevent.core.feed.facebook.api; - -public class Commenter { - - private String name; - private String id; - - public Commenter() { - } - - public String getName() { - return this.name; - } - - public String getId() { - return this.id; - } - - public void setName(String name) { - this.name = name; - } - - public void setId(String id) { - this.id = id; - } - - public boolean equals(Object o) { - if (o == this) return true; - if (!(o instanceof Commenter)) return false; - final Commenter other = (Commenter) o; - if (!other.canEqual((Object) this)) return false; - final Object this$name = this.getName(); - final Object other$name = other.getName(); - if (this$name == null ? other$name != null : !this$name.equals(other$name)) 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; - return true; - } - - public int hashCode() { - final int PRIME = 59; - int result = 1; - final Object $name = this.getName(); - result = result * PRIME + ($name == null ? 43 : $name.hashCode()); - final Object $id = this.getId(); - result = result * PRIME + ($id == null ? 43 : $id.hashCode()); - return result; - } - - protected boolean canEqual(Object other) { - return other instanceof Commenter; - } - - public String toString() { - return "Commenter(name=" + this.getName() + ", id=" + this.getId() + ")"; - } -} \ No newline at end of file diff --git a/android/app/src/main/java/org/fossasia/openevent/core/feed/facebook/api/Commenter.kt b/android/app/src/main/java/org/fossasia/openevent/core/feed/facebook/api/Commenter.kt new file mode 100644 index 0000000000..e36a45d352 --- /dev/null +++ b/android/app/src/main/java/org/fossasia/openevent/core/feed/facebook/api/Commenter.kt @@ -0,0 +1,6 @@ +package org.fossasia.openevent.core.feed.facebook.api + +data class Commenter ( + var name: String? = null, + var id: String? = null +) \ No newline at end of file diff --git a/android/app/src/main/java/org/fossasia/openevent/core/feed/facebook/api/Comments.java b/android/app/src/main/java/org/fossasia/openevent/core/feed/facebook/api/Comments.java deleted file mode 100644 index 4227147a7c..0000000000 --- a/android/app/src/main/java/org/fossasia/openevent/core/feed/facebook/api/Comments.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.fossasia.openevent.core.feed.facebook.api; - -import java.util.List; - -public class Comments { - - private List data; - - public Comments() { - } - - public List getData() { - return this.data; - } - - public void setData(List data) { - this.data = data; - } - - public boolean equals(Object o) { - if (o == this) return true; - if (!(o instanceof Comments)) return false; - final Comments other = (Comments) o; - if (!other.canEqual((Object) this)) return false; - final Object this$data = this.getData(); - final Object other$data = other.getData(); - if (this$data == null ? other$data != null : !this$data.equals(other$data)) return false; - return true; - } - - 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; - } - - protected boolean canEqual(Object other) { - return other instanceof Comments; - } - - public String toString() { - return "Comments(data=" + this.getData() + ")"; - } -} \ No newline at end of file diff --git a/android/app/src/main/java/org/fossasia/openevent/core/feed/facebook/api/Comments.kt b/android/app/src/main/java/org/fossasia/openevent/core/feed/facebook/api/Comments.kt new file mode 100644 index 0000000000..b0fe3acfef --- /dev/null +++ b/android/app/src/main/java/org/fossasia/openevent/core/feed/facebook/api/Comments.kt @@ -0,0 +1,3 @@ +package org.fossasia.openevent.core.feed.facebook.api + +data class Comments ( var data: List? = null ) \ No newline at end of file diff --git a/android/app/src/main/java/org/fossasia/openevent/core/feed/facebook/api/FacebookPageId.java b/android/app/src/main/java/org/fossasia/openevent/core/feed/facebook/api/FacebookPageId.java deleted file mode 100644 index 50920b0d3c..0000000000 --- a/android/app/src/main/java/org/fossasia/openevent/core/feed/facebook/api/FacebookPageId.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.fossasia.openevent.core.feed.facebook.api; - -public class FacebookPageId { - - private String name; - private String id; - - public FacebookPageId() { - } - - public String getName() { - return this.name; - } - - public String getId() { - return this.id; - } - - public void setName(String name) { - this.name = name; - } - - public void setId(String id) { - this.id = id; - } - - public boolean equals(Object o) { - if (o == this) return true; - if (!(o instanceof FacebookPageId)) return false; - final FacebookPageId other = (FacebookPageId) o; - if (!other.canEqual((Object) this)) return false; - final Object this$name = this.getName(); - final Object other$name = other.getName(); - if (this$name == null ? other$name != null : !this$name.equals(other$name)) 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; - return true; - } - - public int hashCode() { - final int PRIME = 59; - int result = 1; - final Object $name = this.getName(); - result = result * PRIME + ($name == null ? 43 : $name.hashCode()); - final Object $id = this.getId(); - result = result * PRIME + ($id == null ? 43 : $id.hashCode()); - return result; - } - - protected boolean canEqual(Object other) { - return other instanceof FacebookPageId; - } - - public String toString() { - return "FacebookPageId(name=" + this.getName() + ", id=" + this.getId() + ")"; - } -} \ No newline at end of file diff --git a/android/app/src/main/java/org/fossasia/openevent/core/feed/facebook/api/FacebookPageId.kt b/android/app/src/main/java/org/fossasia/openevent/core/feed/facebook/api/FacebookPageId.kt new file mode 100644 index 0000000000..8b8281ee87 --- /dev/null +++ b/android/app/src/main/java/org/fossasia/openevent/core/feed/facebook/api/FacebookPageId.kt @@ -0,0 +1,6 @@ +package org.fossasia.openevent.core.feed.facebook.api + +data class FacebookPageId ( + var name: String? = null, + var id: String? = null + ) \ No newline at end of file diff --git a/android/app/src/main/java/org/fossasia/openevent/core/feed/facebook/api/Feed.java b/android/app/src/main/java/org/fossasia/openevent/core/feed/facebook/api/Feed.java deleted file mode 100644 index 0c358f6f50..0000000000 --- a/android/app/src/main/java/org/fossasia/openevent/core/feed/facebook/api/Feed.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.fossasia.openevent.core.feed.facebook.api; - -import java.util.ArrayList; - -public class Feed { - - private ArrayList data; - - public Feed() { - } - - public ArrayList getData() { - return this.data; - } - - public void setData(ArrayList data) { - this.data = data; - } - - public boolean equals(Object o) { - if (o == this) return true; - if (!(o instanceof Feed)) return false; - final Feed other = (Feed) o; - if (!other.canEqual((Object) this)) return false; - final Object this$data = this.getData(); - final Object other$data = other.getData(); - if (this$data == null ? other$data != null : !this$data.equals(other$data)) return false; - return true; - } - - 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; - } - - protected boolean canEqual(Object other) { - return other instanceof Feed; - } - - public String toString() { - return "Feed(data=" + this.getData() + ")"; - } -} \ No newline at end of file diff --git a/android/app/src/main/java/org/fossasia/openevent/core/feed/facebook/api/Feed.kt b/android/app/src/main/java/org/fossasia/openevent/core/feed/facebook/api/Feed.kt new file mode 100644 index 0000000000..9735699f07 --- /dev/null +++ b/android/app/src/main/java/org/fossasia/openevent/core/feed/facebook/api/Feed.kt @@ -0,0 +1,5 @@ +package org.fossasia.openevent.core.feed.facebook.api + +import java.util.ArrayList + +data class Feed ( var data: ArrayList? = null ) \ No newline at end of file diff --git a/android/app/src/main/java/org/fossasia/openevent/core/feed/facebook/api/FeedItem.java b/android/app/src/main/java/org/fossasia/openevent/core/feed/facebook/api/FeedItem.java deleted file mode 100644 index 8d0cd176cc..0000000000 --- a/android/app/src/main/java/org/fossasia/openevent/core/feed/facebook/api/FeedItem.java +++ /dev/null @@ -1,124 +0,0 @@ -package org.fossasia.openevent.core.feed.facebook.api; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.databind.PropertyNamingStrategy; -import com.fasterxml.jackson.databind.annotation.JsonNaming; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class) -public class FeedItem { - - private String id; - private String message; - private String createdTime; - private Comments comments; - private String fullPicture; - private String link; - - public FeedItem() { - } - - public String getId() { - return this.id; - } - - public String getMessage() { - return this.message; - } - - public String getCreatedTime() { - return this.createdTime; - } - - public Comments getComments() { - return this.comments; - } - - public String getFullPicture() { - return this.fullPicture; - } - - public String getLink() { - return this.link; - } - - public void setId(String id) { - this.id = id; - } - - public void setMessage(String message) { - this.message = message; - } - - public void setCreatedTime(String createdTime) { - this.createdTime = createdTime; - } - - public void setComments(Comments comments) { - this.comments = comments; - } - - public void setFullPicture(String fullPicture) { - this.fullPicture = fullPicture; - } - - public void setLink(String link) { - this.link = link; - } - - public boolean equals(Object o) { - if (o == this) return true; - if (!(o instanceof FeedItem)) return false; - final FeedItem other = (FeedItem) 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$message = this.getMessage(); - final Object other$message = other.getMessage(); - if (this$message == null ? other$message != null : !this$message.equals(other$message)) - return false; - final Object this$createdTime = this.getCreatedTime(); - final Object other$createdTime = other.getCreatedTime(); - if (this$createdTime == null ? other$createdTime != null : !this$createdTime.equals(other$createdTime)) - return false; - final Object this$comments = this.getComments(); - final Object other$comments = other.getComments(); - if (this$comments == null ? other$comments != null : !this$comments.equals(other$comments)) - return false; - final Object this$fullPicture = this.getFullPicture(); - final Object other$fullPicture = other.getFullPicture(); - if (this$fullPicture == null ? other$fullPicture != null : !this$fullPicture.equals(other$fullPicture)) - return false; - final Object this$link = this.getLink(); - final Object other$link = other.getLink(); - if (this$link == null ? other$link != null : !this$link.equals(other$link)) return false; - return true; - } - - 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 $message = this.getMessage(); - result = result * PRIME + ($message == null ? 43 : $message.hashCode()); - final Object $createdTime = this.getCreatedTime(); - result = result * PRIME + ($createdTime == null ? 43 : $createdTime.hashCode()); - final Object $comments = this.getComments(); - result = result * PRIME + ($comments == null ? 43 : $comments.hashCode()); - final Object $fullPicture = this.getFullPicture(); - result = result * PRIME + ($fullPicture == null ? 43 : $fullPicture.hashCode()); - final Object $link = this.getLink(); - result = result * PRIME + ($link == null ? 43 : $link.hashCode()); - return result; - } - - protected boolean canEqual(Object other) { - return other instanceof FeedItem; - } - - public String toString() { - return "FeedItem(id=" + this.getId() + ", message=" + this.getMessage() + ", createdTime=" + this.getCreatedTime() + ", comments=" + this.getComments() + ", fullPicture=" + this.getFullPicture() + ", link=" + this.getLink() + ")"; - } -} \ No newline at end of file diff --git a/android/app/src/main/java/org/fossasia/openevent/core/feed/facebook/api/FeedItem.kt b/android/app/src/main/java/org/fossasia/openevent/core/feed/facebook/api/FeedItem.kt new file mode 100644 index 0000000000..63f418ed22 --- /dev/null +++ b/android/app/src/main/java/org/fossasia/openevent/core/feed/facebook/api/FeedItem.kt @@ -0,0 +1,16 @@ +package org.fossasia.openevent.core.feed.facebook.api + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties +import com.fasterxml.jackson.databind.PropertyNamingStrategy +import com.fasterxml.jackson.databind.annotation.JsonNaming + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy::class) +data class FeedItem ( + var id: String? = null, + var message: String? = null, + var createdTime: String? = null, + var comments: Comments? = null, + var fullPicture: String? = null, + var link: String? = null + ) \ No newline at end of file diff --git a/android/app/src/main/java/org/fossasia/openevent/core/feed/twitter/api/TwitterFeed.java b/android/app/src/main/java/org/fossasia/openevent/core/feed/twitter/api/TwitterFeed.java deleted file mode 100644 index 4a5a4302e9..0000000000 --- a/android/app/src/main/java/org/fossasia/openevent/core/feed/twitter/api/TwitterFeed.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.fossasia.openevent.core.feed.twitter.api; - -import java.util.ArrayList; - -public class TwitterFeed { - - private ArrayList statuses; - - public TwitterFeed() { - } - - public ArrayList getStatuses() { - return this.statuses; - } - - public void setStatuses(ArrayList statuses) { - this.statuses = statuses; - } - - public boolean equals(Object o) { - if (o == this) return true; - if (!(o instanceof TwitterFeed)) return false; - final TwitterFeed other = (TwitterFeed) o; - if (!other.canEqual((Object) this)) return false; - final Object this$statuses = this.getStatuses(); - final Object other$statuses = other.getStatuses(); - if (this$statuses == null ? other$statuses != null : !this$statuses.equals(other$statuses)) - return false; - return true; - } - - public int hashCode() { - final int PRIME = 59; - int result = 1; - final Object $statuses = this.getStatuses(); - result = result * PRIME + ($statuses == null ? 43 : $statuses.hashCode()); - return result; - } - - protected boolean canEqual(Object other) { - return other instanceof TwitterFeed; - } - - public String toString() { - return "TwitterFeed(statuses=" + this.getStatuses() + ")"; - } -} diff --git a/android/app/src/main/java/org/fossasia/openevent/core/feed/twitter/api/TwitterFeed.kt b/android/app/src/main/java/org/fossasia/openevent/core/feed/twitter/api/TwitterFeed.kt new file mode 100644 index 0000000000..2293f3f7cc --- /dev/null +++ b/android/app/src/main/java/org/fossasia/openevent/core/feed/twitter/api/TwitterFeed.kt @@ -0,0 +1,5 @@ +package org.fossasia.openevent.core.feed.twitter.api + +import java.util.ArrayList + +data class TwitterFeed ( var statuses: ArrayList? = null ) diff --git a/android/app/src/main/java/org/fossasia/openevent/core/feed/twitter/api/TwitterFeedItem.java b/android/app/src/main/java/org/fossasia/openevent/core/feed/twitter/api/TwitterFeedItem.java deleted file mode 100644 index e9e2c9a89e..0000000000 --- a/android/app/src/main/java/org/fossasia/openevent/core/feed/twitter/api/TwitterFeedItem.java +++ /dev/null @@ -1,125 +0,0 @@ -package org.fossasia.openevent.core.feed.twitter.api; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.databind.PropertyNamingStrategy; -import com.fasterxml.jackson.databind.annotation.JsonNaming; - -import java.util.ArrayList; - -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class) -public class TwitterFeedItem { - private String link; - private ArrayList hashTags; - private ArrayList links; - private ArrayList images; - private String text; - private String createdAt; - - public TwitterFeedItem() { - } - - public String getLink() { - return this.link; - } - - public ArrayList getHashTags() { - return this.hashTags; - } - - public ArrayList getLinks() { - return this.links; - } - - public ArrayList getImages() { - return this.images; - } - - public String getText() { - return this.text; - } - - public String getCreatedAt() { - return this.createdAt; - } - - public void setLink(String link) { - this.link = link; - } - - public void setHashTags(ArrayList hashTags) { - this.hashTags = hashTags; - } - - public void setLinks(ArrayList links) { - this.links = links; - } - - public void setImages(ArrayList images) { - this.images = images; - } - - public void setText(String text) { - this.text = text; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public boolean equals(Object o) { - if (o == this) return true; - if (!(o instanceof TwitterFeedItem)) return false; - final TwitterFeedItem other = (TwitterFeedItem) o; - if (!other.canEqual((Object) this)) return false; - final Object this$link = this.getLink(); - final Object other$link = other.getLink(); - if (this$link == null ? other$link != null : !this$link.equals(other$link)) return false; - final Object this$hashTags = this.getHashTags(); - final Object other$hashTags = other.getHashTags(); - if (this$hashTags == null ? other$hashTags != null : !this$hashTags.equals(other$hashTags)) - return false; - final Object this$links = this.getLinks(); - final Object other$links = other.getLinks(); - if (this$links == null ? other$links != null : !this$links.equals(other$links)) - return false; - final Object this$images = this.getImages(); - final Object other$images = other.getImages(); - if (this$images == null ? other$images != null : !this$images.equals(other$images)) - return false; - final Object this$text = this.getText(); - final Object other$text = other.getText(); - if (this$text == null ? other$text != null : !this$text.equals(other$text)) return false; - final Object this$createdAt = this.getCreatedAt(); - final Object other$createdAt = other.getCreatedAt(); - if (this$createdAt == null ? other$createdAt != null : !this$createdAt.equals(other$createdAt)) - return false; - return true; - } - - public int hashCode() { - final int PRIME = 59; - int result = 1; - final Object $link = this.getLink(); - result = result * PRIME + ($link == null ? 43 : $link.hashCode()); - final Object $hashTags = this.getHashTags(); - result = result * PRIME + ($hashTags == null ? 43 : $hashTags.hashCode()); - final Object $links = this.getLinks(); - result = result * PRIME + ($links == null ? 43 : $links.hashCode()); - final Object $images = this.getImages(); - result = result * PRIME + ($images == null ? 43 : $images.hashCode()); - final Object $text = this.getText(); - result = result * PRIME + ($text == null ? 43 : $text.hashCode()); - final Object $createdAt = this.getCreatedAt(); - result = result * PRIME + ($createdAt == null ? 43 : $createdAt.hashCode()); - return result; - } - - protected boolean canEqual(Object other) { - return other instanceof TwitterFeedItem; - } - - public String toString() { - return "TwitterFeedItem(link=" + this.getLink() + ", hashTags=" + this.getHashTags() + ", links=" + this.getLinks() + ", images=" + this.getImages() + ", text=" + this.getText() + ", createdAt=" + this.getCreatedAt() + ")"; - } -} diff --git a/android/app/src/main/java/org/fossasia/openevent/core/feed/twitter/api/TwitterFeedItem.kt b/android/app/src/main/java/org/fossasia/openevent/core/feed/twitter/api/TwitterFeedItem.kt new file mode 100644 index 0000000000..ddbfba816f --- /dev/null +++ b/android/app/src/main/java/org/fossasia/openevent/core/feed/twitter/api/TwitterFeedItem.kt @@ -0,0 +1,18 @@ +package org.fossasia.openevent.core.feed.twitter.api + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties +import com.fasterxml.jackson.databind.PropertyNamingStrategy +import com.fasterxml.jackson.databind.annotation.JsonNaming + +import java.util.ArrayList + +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy::class) +data class TwitterFeedItem ( + var link: String? = null, + var hashTags: ArrayList? = null, + var links: ArrayList? = null, + var images: ArrayList? = null, + var text: String? = null, + var createdAt: String? = null + ) diff --git a/android/app/src/main/java/org/fossasia/openevent/core/schedule/DayScheduleAdapter.java b/android/app/src/main/java/org/fossasia/openevent/core/schedule/DayScheduleAdapter.java index f5a4b80cf9..296e40f484 100644 --- a/android/app/src/main/java/org/fossasia/openevent/core/schedule/DayScheduleAdapter.java +++ b/android/app/src/main/java/org/fossasia/openevent/core/schedule/DayScheduleAdapter.java @@ -59,14 +59,14 @@ public void onDetachedFromRecyclerView(RecyclerView recyclerView) { @Override public long getHeaderId(int position) { String id = ""; - if (SortOrder.sortTypeSchedule().equals(Session.TITLE)) { + if (SortOrder.sortTypeSchedule().equals(Session.Companion.getTITLE())) { return getItem(position).getTitle().toUpperCase().charAt(0); - } else if (SortOrder.sortTypeSchedule().equals(Session.TRACK)){ + } else if (SortOrder.sortTypeSchedule().equals(Session.Companion.getTRACK())){ if (tracks != null && !tracks.contains(getItem(position).getTrack().getName())) { tracks.add(getItem(position).getTrack().getName()); } return tracks.indexOf(getItem(position).getTrack().getName()); - } else if (SortOrder.sortTypeSchedule().equals(Session.START_TIME)) { + } else if (SortOrder.sortTypeSchedule().equals(Session.Companion.getSTART_TIME())) { id = DateConverter.formatDateWithDefault(DateConverter.FORMAT_24H, getItem(position).getStartsAt(), "") .replace(":", "") .replace(" ", ""); @@ -86,11 +86,11 @@ public void onBindHeaderViewHolder(HeaderViewHolder holder, int position) { String sortTitle = Utils.checkStringEmpty(getItem(position).getTitle()); String sortName = Utils.checkStringEmpty(getItem(position).getTrack().getName()); - if (SortOrder.sortTypeSchedule().equals(Session.TITLE) && (!Utils.isEmpty(sortTitle))) { + if (SortOrder.sortTypeSchedule().equals(Session.Companion.getTITLE()) && (!Utils.isEmpty(sortTitle))) { holder.header.setText(String.valueOf(sortTitle.toUpperCase().charAt(0))); - } else if (SortOrder.sortTypeSchedule().equals(Session.TRACK)){ + } else if (SortOrder.sortTypeSchedule().equals(Session.Companion.getTRACK())){ holder.header.setText(String.valueOf(sortName)); - } else if (SortOrder.sortTypeSchedule().equals(Session.START_TIME)) { + } else if (SortOrder.sortTypeSchedule().equals(Session.Companion.getSTART_TIME())) { holder.header.setText(DateConverter.formatDateWithDefault(DateConverter.FORMAT_24H, getItem(position).getStartsAt())); } } diff --git a/android/app/src/main/java/org/fossasia/openevent/core/schedule/DayScheduleViewHolder.java b/android/app/src/main/java/org/fossasia/openevent/core/schedule/DayScheduleViewHolder.java index 381af43c7a..08ee9d1406 100644 --- a/android/app/src/main/java/org/fossasia/openevent/core/schedule/DayScheduleViewHolder.java +++ b/android/app/src/main/java/org/fossasia/openevent/core/schedule/DayScheduleViewHolder.java @@ -89,7 +89,7 @@ public void bindSession(RealmDataRepository realmRepo) { slotTrack.getBackground().setColorFilter(storedColor, PorterDuff.Mode.SRC_ATOP); slotTrack.setText(sessionTrack.getName()); - if (session.getIsBookmarked()) { + if (session.isBookmarked()) { slotBookmark.setImageResource(R.drawable.ic_bookmark_white_24dp); } else { slotBookmark.setImageResource(R.drawable.ic_bookmark_border_white_24dp); @@ -99,7 +99,7 @@ public void bindSession(RealmDataRepository realmRepo) { final int sessionId = session.getId(); slotBookmark.setOnClickListener(v -> { - if (session.getIsBookmarked()) { + if (session.isBookmarked()) { realmRepo.setBookmark(sessionId, false).subscribe(); slotBookmark.setImageResource(R.drawable.ic_bookmark_border_white_24dp); diff --git a/android/app/src/main/java/org/fossasia/openevent/core/speaker/SpeakerDetailsActivity.java b/android/app/src/main/java/org/fossasia/openevent/core/speaker/SpeakerDetailsActivity.java index 337e7538ae..c25c42bf96 100644 --- a/android/app/src/main/java/org/fossasia/openevent/core/speaker/SpeakerDetailsActivity.java +++ b/android/app/src/main/java/org/fossasia/openevent/core/speaker/SpeakerDetailsActivity.java @@ -128,7 +128,7 @@ public void openUrl(View v) { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - speakerName = getIntent().getStringExtra(Speaker.SPEAKER); + speakerName = getIntent().getStringExtra(Speaker.Companion.getSPEAKER()); setSupportActionBar(toolbar); if(getSupportActionBar() != null) getSupportActionBar().setDisplayHomeAsUpEnabled(true); collapsingToolbarLayout.setTitle(" "); diff --git a/android/app/src/main/java/org/fossasia/openevent/core/speaker/SpeakerViewHolder.java b/android/app/src/main/java/org/fossasia/openevent/core/speaker/SpeakerViewHolder.java index b70ec20358..ecdf467c7f 100644 --- a/android/app/src/main/java/org/fossasia/openevent/core/speaker/SpeakerViewHolder.java +++ b/android/app/src/main/java/org/fossasia/openevent/core/speaker/SpeakerViewHolder.java @@ -67,7 +67,7 @@ public SpeakerViewHolder(View itemView, Context context) { itemView.setOnClickListener(view -> { String speakerName = speaker.getName(); Intent intent = new Intent(this.context, SpeakerDetailsActivity.class); - intent.putExtra(Speaker.SPEAKER, speakerName); + intent.putExtra(Speaker.Companion.getSPEAKER(), speakerName); try{ if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP){ diff --git a/android/app/src/main/java/org/fossasia/openevent/core/track/session/SessionDetailActivity.java b/android/app/src/main/java/org/fossasia/openevent/core/track/session/SessionDetailActivity.java index ac12be9e18..94b00586f4 100644 --- a/android/app/src/main/java/org/fossasia/openevent/core/track/session/SessionDetailActivity.java +++ b/android/app/src/main/java/org/fossasia/openevent/core/track/session/SessionDetailActivity.java @@ -168,7 +168,7 @@ public void onCreate(final Bundle savedInstanceState) { return; } - if(session.getIsBookmarked()) { + if(session.isBookmarked()) { Timber.tag(TAG).d("Bookmark Removed"); sessionDetailActivityViewModel.setBookmark(session, false); @@ -274,7 +274,7 @@ private void updateSession() { private void updateFloatingIcon() { fabSessionBookmark.setColorFilter(fontColor, PorterDuff.Mode.SRC_ATOP); - if(session.getIsBookmarked()) { + if(session.isBookmarked()) { Timber.tag(TAG).d("Bookmarked"); fabSessionBookmark.setImageResource(R.drawable.ic_bookmark_white_24dp); } else { diff --git a/android/app/src/main/java/org/fossasia/openevent/core/track/session/SessionViewHolder.java b/android/app/src/main/java/org/fossasia/openevent/core/track/session/SessionViewHolder.java index 4fa1ec0d7b..904457bafc 100644 --- a/android/app/src/main/java/org/fossasia/openevent/core/track/session/SessionViewHolder.java +++ b/android/app/src/main/java/org/fossasia/openevent/core/track/session/SessionViewHolder.java @@ -182,7 +182,7 @@ public void bindSession(int type, int colorInTracks, RealmDataRepository realmRe sessionHeader.setBackgroundColor(color); if (track != null && track.isValid()) { sessionTitle.setTextColor(Color.parseColor(track.getFontColor())); - setBookmarkIcon(sessionBookmarkIcon, session.getIsBookmarked(), track.getFontColor()); + setBookmarkIcon(sessionBookmarkIcon, session.isBookmarked(), track.getFontColor()); } } @@ -242,7 +242,7 @@ private void setBookmarkClickListener(RealmDataRepository realmRepo, Track track sessionBookmarkIcon.setOnClickListener(v -> { if (track == null) return; - if (session.getIsBookmarked()) { + if (session.isBookmarked()) { realmRepo.setBookmark(sessionId, false).subscribe(); setBookmarkIcon(sessionBookmarkIcon, false, track.getFontColor()); diff --git a/android/app/src/main/java/org/fossasia/openevent/data/Event.java b/android/app/src/main/java/org/fossasia/openevent/data/Event.java deleted file mode 100644 index b1796b3d1d..0000000000 --- a/android/app/src/main/java/org/fossasia/openevent/data/Event.java +++ /dev/null @@ -1,538 +0,0 @@ -package org.fossasia.openevent.data; - -import com.fasterxml.jackson.databind.PropertyNamingStrategy; -import com.fasterxml.jackson.databind.annotation.JsonNaming; -import com.github.jasminb.jsonapi.IntegerIdHandler; -import com.github.jasminb.jsonapi.annotations.Id; -import com.github.jasminb.jsonapi.annotations.Relationship; -import com.github.jasminb.jsonapi.annotations.Type; - -import org.fossasia.openevent.data.extras.Copyright; -import org.fossasia.openevent.data.extras.SocialLink; -import org.fossasia.openevent.data.extras.SpeakersCall; - -import io.realm.RealmList; -import io.realm.RealmObject; -import io.realm.annotations.PrimaryKey; - -@Type("event") -@JsonNaming(PropertyNamingStrategy.KebabCaseStrategy.class) -public class Event extends RealmObject { - - @PrimaryKey - @Id(IntegerIdHandler.class) - private int id; - private String identifier; - private String name; - private Double latitude; - private Double longitude; - private String locationName; - private String startsAt; - private String endsAt; - private String timezone; - private String description; - private String logoUrl; - private String organizerName; - private String organizerDescription; - private String ticketUrl; - private String privacy; - private String type; - private String topic; - private String subTopic; - private String codeOfConduct; - private String email; - private String schedulePublishedOn; - private String searchableLocationName; - private String state; - private boolean isSessionsSpeakersEnabled; - private String thumbnailImageUrl; - private String originalImageUrl; - private String largeImageUrl; - private String iconImageUrl; - private String createdAt; - private String deletedAt; - @Relationship("event-copyright") - private Copyright eventCopyright; - @Relationship("speakers-call") - private SpeakersCall speakersCall; - @Relationship("social-links") - private RealmList socialLinks; - - public Event() { - } - - public int getId() { - return this.id; - } - - public String getIdentifier() { - return this.identifier; - } - - public String getName() { - return this.name; - } - - public Double getLatitude() { - return this.latitude; - } - - public Double getLongitude() { - return this.longitude; - } - - public String getLocationName() { - return this.locationName; - } - - public String getStartsAt() { - return this.startsAt; - } - - public String getEndsAt() { - return this.endsAt; - } - - public String getTimezone() { - return this.timezone; - } - - public String getDescription() { - return this.description; - } - - public String getLogoUrl() { - return this.logoUrl; - } - - public String getOrganizerName() { - return this.organizerName; - } - - public String getOrganizerDescription() { - return this.organizerDescription; - } - - public String getTicketUrl() { - return this.ticketUrl; - } - - public String getPrivacy() { - return this.privacy; - } - - public String getType() { - return this.type; - } - - public String getTopic() { - return this.topic; - } - - public String getSubTopic() { - return this.subTopic; - } - - public String getCodeOfConduct() { - return this.codeOfConduct; - } - - public String getEmail() { - return this.email; - } - - public String getSchedulePublishedOn() { - return this.schedulePublishedOn; - } - - public String getSearchableLocationName() { - return this.searchableLocationName; - } - - public String getState() { - return this.state; - } - - public boolean getIsSessionsSpeakersEnabled() { - return this.isSessionsSpeakersEnabled; - } - - public String getThumbnailImageUrl() { - return this.thumbnailImageUrl; - } - - public String getOriginalImageUrl() { - return this.originalImageUrl; - } - - public String getLargeImageUrl() { - return this.largeImageUrl; - } - - public String getIconImageUrl() { - return this.iconImageUrl; - } - - public String getCreatedAt() { - return this.createdAt; - } - - public String getDeletedAt() { - return this.deletedAt; - } - - public Copyright getEventCopyright() { - return this.eventCopyright; - } - - public SpeakersCall getSpeakersCall() { - return this.speakersCall; - } - - public RealmList getSocialLinks() { - return this.socialLinks; - } - - public void setId(int id) { - this.id = id; - } - - public void setIdentifier(String identifier) { - this.identifier = identifier; - } - - public void setName(String name) { - this.name = name; - } - - public void setLatitude(Double latitude) { - this.latitude = latitude; - } - - public void setLongitude(Double longitude) { - this.longitude = longitude; - } - - public void setLocationName(String locationName) { - this.locationName = locationName; - } - - public void setStartsAt(String startsAt) { - this.startsAt = startsAt; - } - - public void setEndsAt(String endsAt) { - this.endsAt = endsAt; - } - - public void setTimezone(String timezone) { - this.timezone = timezone; - } - - public void setDescription(String description) { - this.description = description; - } - - public void setLogoUrl(String logoUrl) { - this.logoUrl = logoUrl; - } - - public void setOrganizerName(String organizerName) { - this.organizerName = organizerName; - } - - public void setOrganizerDescription(String organizerDescription) { - this.organizerDescription = organizerDescription; - } - - public void setTicketUrl(String ticketUrl) { - this.ticketUrl = ticketUrl; - } - - public void setPrivacy(String privacy) { - this.privacy = privacy; - } - - public void setType(String type) { - this.type = type; - } - - public void setTopic(String topic) { - this.topic = topic; - } - - public void setSubTopic(String subTopic) { - this.subTopic = subTopic; - } - - public void setCodeOfConduct(String codeOfConduct) { - this.codeOfConduct = codeOfConduct; - } - - public void setEmail(String email) { - this.email = email; - } - - public void setSchedulePublishedOn(String schedulePublishedOn) { - this.schedulePublishedOn = schedulePublishedOn; - } - - public void setSearchableLocationName(String searchableLocationName) { - this.searchableLocationName = searchableLocationName; - } - - public void setState(String state) { - this.state = state; - } - - public void setIsSessionsSpeakersEnabled(boolean isSessionsSpeakersEnabled) { - this.isSessionsSpeakersEnabled = isSessionsSpeakersEnabled; - } - - public void setThumbnailImageUrl(String thumbnailImageUrl) { - this.thumbnailImageUrl = thumbnailImageUrl; - } - - public void setOriginalImageUrl(String originalImageUrl) { - this.originalImageUrl = originalImageUrl; - } - - public void setLargeImageUrl(String largeImageUrl) { - this.largeImageUrl = largeImageUrl; - } - - public void setIconImageUrl(String iconImageUrl) { - this.iconImageUrl = iconImageUrl; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public void setDeletedAt(String deletedAt) { - this.deletedAt = deletedAt; - } - - public void setEventCopyright(Copyright eventCopyright) { - this.eventCopyright = eventCopyright; - } - - public void setSpeakersCall(SpeakersCall speakersCall) { - this.speakersCall = speakersCall; - } - - public void setSocialLinks(RealmList socialLinks) { - this.socialLinks = socialLinks; - } - - public String toString() { - return "Event(id=" + this.getId() + ", identifier=" + this.getIdentifier() + ", name=" + this.getName() + ", latitude=" + this.getLatitude() + ", longitude=" + this.getLongitude() + ", locationName=" + this.getLocationName() + ", startsAt=" + this.getStartsAt() + ", endsAt=" + this.getEndsAt() + ", timezone=" + this.getTimezone() + ", description=" + this.getDescription() + ", logoUrl=" + this.getLogoUrl() + ", organizerName=" + this.getOrganizerName() + ", organizerDescription=" + this.getOrganizerDescription() + ", ticketUrl=" + this.getTicketUrl() + ", privacy=" + this.getPrivacy() + ", type=" + this.getType() + ", topic=" + this.getTopic() + ", subTopic=" + this.getSubTopic() + ", codeOfConduct=" + this.getCodeOfConduct() + ", email=" + this.getEmail() + ", schedulePublishedOn=" + this.getSchedulePublishedOn() + ", searchableLocationName=" + this.getSearchableLocationName() + ", state=" + this.getState() + ", isSessionsSpeakersEnabled=" + this.getIsSessionsSpeakersEnabled() + ", thumbnailImageUrl=" + this.getThumbnailImageUrl() + ", originalImageUrl=" + this.getOriginalImageUrl() + ", largeImageUrl=" + this.getLargeImageUrl() + ", iconImageUrl=" + this.getIconImageUrl() + ", createdAt=" + this.getCreatedAt() + ", deletedAt=" + this.getDeletedAt() + ", eventCopyright=" + this.getEventCopyright() + ", speakersCall=" + this.getSpeakersCall() + ", socialLinks=" + this.getSocialLinks() + ")"; - } - - public boolean equals(Object o) { - if (o == this) return true; - if (!(o instanceof Event)) return false; - final Event other = (Event) o; - if (!other.canEqual((Object) this)) return false; - if (this.getId() != other.getId()) return false; - final Object this$identifier = this.getIdentifier(); - final Object other$identifier = other.getIdentifier(); - if (this$identifier == null ? other$identifier != null : !this$identifier.equals(other$identifier)) - return false; - final Object this$name = this.getName(); - final Object other$name = other.getName(); - if (this$name == null ? other$name != null : !this$name.equals(other$name)) return false; - final Object this$latitude = this.getLatitude(); - final Object other$latitude = other.getLatitude(); - if (this$latitude == null ? other$latitude != null : !this$latitude.equals(other$latitude)) - return false; - final Object this$longitude = this.getLongitude(); - final Object other$longitude = other.getLongitude(); - if (this$longitude == null ? other$longitude != null : !this$longitude.equals(other$longitude)) - return false; - final Object this$locationName = this.getLocationName(); - final Object other$locationName = other.getLocationName(); - if (this$locationName == null ? other$locationName != null : !this$locationName.equals(other$locationName)) - return false; - final Object this$startsAt = this.getStartsAt(); - final Object other$startsAt = other.getStartsAt(); - if (this$startsAt == null ? other$startsAt != null : !this$startsAt.equals(other$startsAt)) - return false; - final Object this$endsAt = this.getEndsAt(); - final Object other$endsAt = other.getEndsAt(); - if (this$endsAt == null ? other$endsAt != null : !this$endsAt.equals(other$endsAt)) - return false; - final Object this$timezone = this.getTimezone(); - final Object other$timezone = other.getTimezone(); - if (this$timezone == null ? other$timezone != null : !this$timezone.equals(other$timezone)) - return false; - final Object this$description = this.getDescription(); - final Object other$description = other.getDescription(); - if (this$description == null ? other$description != null : !this$description.equals(other$description)) - return false; - final Object this$logoUrl = this.getLogoUrl(); - final Object other$logoUrl = other.getLogoUrl(); - if (this$logoUrl == null ? other$logoUrl != null : !this$logoUrl.equals(other$logoUrl)) - return false; - final Object this$organizerName = this.getOrganizerName(); - final Object other$organizerName = other.getOrganizerName(); - if (this$organizerName == null ? other$organizerName != null : !this$organizerName.equals(other$organizerName)) - return false; - final Object this$organizerDescription = this.getOrganizerDescription(); - final Object other$organizerDescription = other.getOrganizerDescription(); - if (this$organizerDescription == null ? other$organizerDescription != null : !this$organizerDescription.equals(other$organizerDescription)) - return false; - final Object this$ticketUrl = this.getTicketUrl(); - final Object other$ticketUrl = other.getTicketUrl(); - if (this$ticketUrl == null ? other$ticketUrl != null : !this$ticketUrl.equals(other$ticketUrl)) - return false; - final Object this$privacy = this.getPrivacy(); - final Object other$privacy = other.getPrivacy(); - if (this$privacy == null ? other$privacy != null : !this$privacy.equals(other$privacy)) - 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$topic = this.getTopic(); - final Object other$topic = other.getTopic(); - if (this$topic == null ? other$topic != null : !this$topic.equals(other$topic)) - return false; - final Object this$subTopic = this.getSubTopic(); - final Object other$subTopic = other.getSubTopic(); - if (this$subTopic == null ? other$subTopic != null : !this$subTopic.equals(other$subTopic)) - return false; - final Object this$codeOfConduct = this.getCodeOfConduct(); - final Object other$codeOfConduct = other.getCodeOfConduct(); - if (this$codeOfConduct == null ? other$codeOfConduct != null : !this$codeOfConduct.equals(other$codeOfConduct)) - return false; - final Object this$email = this.getEmail(); - final Object other$email = other.getEmail(); - if (this$email == null ? other$email != null : !this$email.equals(other$email)) - return false; - final Object this$schedulePublishedOn = this.getSchedulePublishedOn(); - final Object other$schedulePublishedOn = other.getSchedulePublishedOn(); - if (this$schedulePublishedOn == null ? other$schedulePublishedOn != null : !this$schedulePublishedOn.equals(other$schedulePublishedOn)) - return false; - final Object this$searchableLocationName = this.getSearchableLocationName(); - final Object other$searchableLocationName = other.getSearchableLocationName(); - if (this$searchableLocationName == null ? other$searchableLocationName != null : !this$searchableLocationName.equals(other$searchableLocationName)) - return false; - final Object this$state = this.getState(); - final Object other$state = other.getState(); - if (this$state == null ? other$state != null : !this$state.equals(other$state)) - return false; - if (this.getIsSessionsSpeakersEnabled() != other.getIsSessionsSpeakersEnabled()) - return false; - final Object this$thumbnailImageUrl = this.getThumbnailImageUrl(); - final Object other$thumbnailImageUrl = other.getThumbnailImageUrl(); - if (this$thumbnailImageUrl == null ? other$thumbnailImageUrl != null : !this$thumbnailImageUrl.equals(other$thumbnailImageUrl)) - return false; - final Object this$originalImageUrl = this.getOriginalImageUrl(); - final Object other$originalImageUrl = other.getOriginalImageUrl(); - if (this$originalImageUrl == null ? other$originalImageUrl != null : !this$originalImageUrl.equals(other$originalImageUrl)) - return false; - final Object this$largeImageUrl = this.getLargeImageUrl(); - final Object other$largeImageUrl = other.getLargeImageUrl(); - if (this$largeImageUrl == null ? other$largeImageUrl != null : !this$largeImageUrl.equals(other$largeImageUrl)) - return false; - final Object this$iconImageUrl = this.getIconImageUrl(); - final Object other$iconImageUrl = other.getIconImageUrl(); - if (this$iconImageUrl == null ? other$iconImageUrl != null : !this$iconImageUrl.equals(other$iconImageUrl)) - return false; - final Object this$createdAt = this.getCreatedAt(); - final Object other$createdAt = other.getCreatedAt(); - if (this$createdAt == null ? other$createdAt != null : !this$createdAt.equals(other$createdAt)) - return false; - final Object this$deletedAt = this.getDeletedAt(); - final Object other$deletedAt = other.getDeletedAt(); - if (this$deletedAt == null ? other$deletedAt != null : !this$deletedAt.equals(other$deletedAt)) - return false; - final Object this$eventCopyright = this.getEventCopyright(); - final Object other$eventCopyright = other.getEventCopyright(); - if (this$eventCopyright == null ? other$eventCopyright != null : !this$eventCopyright.equals(other$eventCopyright)) - return false; - final Object this$speakersCall = this.getSpeakersCall(); - final Object other$speakersCall = other.getSpeakersCall(); - if (this$speakersCall == null ? other$speakersCall != null : !this$speakersCall.equals(other$speakersCall)) - return false; - final Object this$socialLinks = this.getSocialLinks(); - final Object other$socialLinks = other.getSocialLinks(); - if (this$socialLinks == null ? other$socialLinks != null : !this$socialLinks.equals(other$socialLinks)) - return false; - return true; - } - - public int hashCode() { - final int PRIME = 59; - int result = 1; - result = result * PRIME + this.getId(); - final Object $identifier = this.getIdentifier(); - result = result * PRIME + ($identifier == null ? 43 : $identifier.hashCode()); - final Object $name = this.getName(); - result = result * PRIME + ($name == null ? 43 : $name.hashCode()); - final Object $latitude = this.getLatitude(); - result = result * PRIME + ($latitude == null ? 43 : $latitude.hashCode()); - final Object $longitude = this.getLongitude(); - result = result * PRIME + ($longitude == null ? 43 : $longitude.hashCode()); - final Object $locationName = this.getLocationName(); - result = result * PRIME + ($locationName == null ? 43 : $locationName.hashCode()); - final Object $startsAt = this.getStartsAt(); - result = result * PRIME + ($startsAt == null ? 43 : $startsAt.hashCode()); - final Object $endsAt = this.getEndsAt(); - result = result * PRIME + ($endsAt == null ? 43 : $endsAt.hashCode()); - final Object $timezone = this.getTimezone(); - result = result * PRIME + ($timezone == null ? 43 : $timezone.hashCode()); - final Object $description = this.getDescription(); - result = result * PRIME + ($description == null ? 43 : $description.hashCode()); - final Object $logoUrl = this.getLogoUrl(); - result = result * PRIME + ($logoUrl == null ? 43 : $logoUrl.hashCode()); - final Object $organizerName = this.getOrganizerName(); - result = result * PRIME + ($organizerName == null ? 43 : $organizerName.hashCode()); - final Object $organizerDescription = this.getOrganizerDescription(); - result = result * PRIME + ($organizerDescription == null ? 43 : $organizerDescription.hashCode()); - final Object $ticketUrl = this.getTicketUrl(); - result = result * PRIME + ($ticketUrl == null ? 43 : $ticketUrl.hashCode()); - final Object $privacy = this.getPrivacy(); - result = result * PRIME + ($privacy == null ? 43 : $privacy.hashCode()); - final Object $type = this.getType(); - result = result * PRIME + ($type == null ? 43 : $type.hashCode()); - final Object $topic = this.getTopic(); - result = result * PRIME + ($topic == null ? 43 : $topic.hashCode()); - final Object $subTopic = this.getSubTopic(); - result = result * PRIME + ($subTopic == null ? 43 : $subTopic.hashCode()); - final Object $codeOfConduct = this.getCodeOfConduct(); - result = result * PRIME + ($codeOfConduct == null ? 43 : $codeOfConduct.hashCode()); - final Object $email = this.getEmail(); - result = result * PRIME + ($email == null ? 43 : $email.hashCode()); - final Object $schedulePublishedOn = this.getSchedulePublishedOn(); - result = result * PRIME + ($schedulePublishedOn == null ? 43 : $schedulePublishedOn.hashCode()); - final Object $searchableLocationName = this.getSearchableLocationName(); - result = result * PRIME + ($searchableLocationName == null ? 43 : $searchableLocationName.hashCode()); - final Object $state = this.getState(); - result = result * PRIME + ($state == null ? 43 : $state.hashCode()); - result = result * PRIME + (this.getIsSessionsSpeakersEnabled() ? 79 : 97); - final Object $thumbnailImageUrl = this.getThumbnailImageUrl(); - result = result * PRIME + ($thumbnailImageUrl == null ? 43 : $thumbnailImageUrl.hashCode()); - final Object $originalImageUrl = this.getOriginalImageUrl(); - result = result * PRIME + ($originalImageUrl == null ? 43 : $originalImageUrl.hashCode()); - final Object $largeImageUrl = this.getLargeImageUrl(); - result = result * PRIME + ($largeImageUrl == null ? 43 : $largeImageUrl.hashCode()); - final Object $iconImageUrl = this.getIconImageUrl(); - result = result * PRIME + ($iconImageUrl == null ? 43 : $iconImageUrl.hashCode()); - final Object $createdAt = this.getCreatedAt(); - result = result * PRIME + ($createdAt == null ? 43 : $createdAt.hashCode()); - final Object $deletedAt = this.getDeletedAt(); - result = result * PRIME + ($deletedAt == null ? 43 : $deletedAt.hashCode()); - final Object $eventCopyright = this.getEventCopyright(); - result = result * PRIME + ($eventCopyright == null ? 43 : $eventCopyright.hashCode()); - final Object $speakersCall = this.getSpeakersCall(); - result = result * PRIME + ($speakersCall == null ? 43 : $speakersCall.hashCode()); - final Object $socialLinks = this.getSocialLinks(); - result = result * PRIME + ($socialLinks == null ? 43 : $socialLinks.hashCode()); - return result; - } - - protected boolean canEqual(Object other) { - return other instanceof Event; - } -} \ No newline at end of file diff --git a/android/app/src/main/java/org/fossasia/openevent/data/Event.kt b/android/app/src/main/java/org/fossasia/openevent/data/Event.kt new file mode 100644 index 0000000000..c7581208d6 --- /dev/null +++ b/android/app/src/main/java/org/fossasia/openevent/data/Event.kt @@ -0,0 +1,59 @@ +package org.fossasia.openevent.data + +import com.fasterxml.jackson.databind.PropertyNamingStrategy +import com.fasterxml.jackson.databind.annotation.JsonNaming +import com.github.jasminb.jsonapi.IntegerIdHandler +import com.github.jasminb.jsonapi.annotations.Id +import com.github.jasminb.jsonapi.annotations.Relationship +import com.github.jasminb.jsonapi.annotations.Type + +import org.fossasia.openevent.data.extras.Copyright +import org.fossasia.openevent.data.extras.SocialLink +import org.fossasia.openevent.data.extras.SpeakersCall + +import io.realm.RealmList +import io.realm.RealmObject +import io.realm.annotations.PrimaryKey + +@Type("event") +@JsonNaming(PropertyNamingStrategy.KebabCaseStrategy::class) +open class Event( + @PrimaryKey + @Id(IntegerIdHandler::class) + var id: Int = 0, + var identifier: String? = null, + var name: String? = null, + var latitude: Double? = null, + var longitude: Double? = null, + var locationName: String? = null, + var startsAt: String? = null, + var endsAt: String? = null, + var timezone: String? = null, + var description: String? = null, + var logoUrl: String? = null, + var organizerName: String? = null, + var organizerDescription: String? = null, + var ticketUrl: String? = null, + var privacy: String? = null, + var type: String? = null, + var topic: String? = null, + var subTopic: String? = null, + var codeOfConduct: String? = null, + var email: String? = null, + var schedulePublishedOn: String? = null, + var searchableLocationName: String? = null, + var state: String? = null, + var isSessionsSpeakersEnabled: Boolean = false, + var thumbnailImageUrl: String? = null, + var originalImageUrl: String? = null, + var largeImageUrl: String? = null, + var iconImageUrl: String? = null, + var createdAt: String? = null, + var deletedAt: String? = null, + @Relationship("event-copyright") + var eventCopyright: Copyright? = null, + @Relationship("speakers-call") + var speakersCall: SpeakersCall? = null, + @Relationship("social-links") + var socialLinks: RealmList? = null +) : RealmObject() \ No newline at end of file diff --git a/android/app/src/main/java/org/fossasia/openevent/data/FAQ.java b/android/app/src/main/java/org/fossasia/openevent/data/FAQ.java deleted file mode 100644 index f33a4ec95e..0000000000 --- a/android/app/src/main/java/org/fossasia/openevent/data/FAQ.java +++ /dev/null @@ -1,91 +0,0 @@ -package org.fossasia.openevent.data; - -import com.fasterxml.jackson.databind.PropertyNamingStrategy; -import com.fasterxml.jackson.databind.annotation.JsonNaming; -import com.github.jasminb.jsonapi.IntegerIdHandler; -import com.github.jasminb.jsonapi.annotations.Id; -import com.github.jasminb.jsonapi.annotations.Type; - -import io.realm.RealmObject; -import io.realm.annotations.PrimaryKey; - -/** - * Created by mayank on 4/2/18. - */ -@Type("faq") -@JsonNaming(PropertyNamingStrategy.KebabCaseStrategy.class) -public class FAQ extends RealmObject { - - @PrimaryKey - @Id(IntegerIdHandler.class) - private int id; - - private String question; - private String answer; - - public FAQ() { - } - - public int getId() { - return this.id; - } - - public String getQuestion() { - return this.question; - } - - public String getAnswer() { - return this.answer; - } - - public void setId(int id) { - this.id = id; - } - - public void setQuestion(String question) { - this.question = question; - } - - public void setAnswer(String answer) { - this.answer = answer; - } - - public String toString() { - return "FAQ(id=" + this.getId() + ", question=" + this.getQuestion() + ", answer=" + this.getAnswer() + ")"; - } - - public boolean equals(Object o) { - if (o == this) return true; - if (!(o instanceof FAQ)) return false; - final FAQ other = (FAQ) o; - if (!other.canEqual((Object) this)) return false; - if (this.getId() != other.getId()) return false; - final Object this$question = this.getQuestion(); - final Object other$question = other.getQuestion(); - if (this$question == null ? other$question != null : !this$question.equals(other$question)) - return false; - final Object this$answer = this.getAnswer(); - final Object other$answer = other.getAnswer(); - if (this$answer == null ? other$answer != null : !this$answer.equals(other$answer)) - return false; - return true; - } - - public int hashCode() { - final int PRIME = 59; - int result = 1; - result = result * PRIME + this.getId(); - final Object $question = this.getQuestion(); - result = result * PRIME + ($question == null ? 43 : $question.hashCode()); - final Object $answer = this.getAnswer(); - result = result * PRIME + ($answer == null ? 43 : $answer.hashCode()); - return result; - } - - protected boolean canEqual(Object other) { - return other instanceof FAQ; - } - -// @Relationship("faq-type") -// private RealmList faqTypes; -} diff --git a/android/app/src/main/java/org/fossasia/openevent/data/FAQ.kt b/android/app/src/main/java/org/fossasia/openevent/data/FAQ.kt new file mode 100644 index 0000000000..f287a6f742 --- /dev/null +++ b/android/app/src/main/java/org/fossasia/openevent/data/FAQ.kt @@ -0,0 +1,27 @@ +package org.fossasia.openevent.data + +import com.fasterxml.jackson.databind.PropertyNamingStrategy +import com.fasterxml.jackson.databind.annotation.JsonNaming +import com.github.jasminb.jsonapi.IntegerIdHandler +import com.github.jasminb.jsonapi.annotations.Id +import com.github.jasminb.jsonapi.annotations.Type + +import io.realm.RealmObject +import io.realm.annotations.PrimaryKey + +/** + * Created by mayank on 4/2/18. + */ +@Type("faq") +@JsonNaming(PropertyNamingStrategy.KebabCaseStrategy::class) +open class FAQ( + @PrimaryKey + @Id(IntegerIdHandler::class) + var id: Int = 0, + var question: String? = null, + var answer: String? = null +) : RealmObject() { + + // @Relationship("faq-type") + // private RealmList faqTypes; +} diff --git a/android/app/src/main/java/org/fossasia/openevent/data/Microlocation.java b/android/app/src/main/java/org/fossasia/openevent/data/Microlocation.java deleted file mode 100644 index 4b4cb2b439..0000000000 --- a/android/app/src/main/java/org/fossasia/openevent/data/Microlocation.java +++ /dev/null @@ -1,130 +0,0 @@ -package org.fossasia.openevent.data; - -import com.fasterxml.jackson.databind.PropertyNamingStrategy; -import com.fasterxml.jackson.databind.annotation.JsonNaming; -import com.github.jasminb.jsonapi.IntegerIdHandler; -import com.github.jasminb.jsonapi.annotations.Id; -import com.github.jasminb.jsonapi.annotations.Type; - -import io.realm.RealmObject; -import io.realm.annotations.PrimaryKey; - -@Type("microlocation") -@JsonNaming(PropertyNamingStrategy.KebabCaseStrategy.class) -public class Microlocation extends RealmObject { - - @PrimaryKey - @Id(IntegerIdHandler.class) - private int id; - private String name; - private float latitude; - private float longitude; - private int floor; - private String room; - - public Microlocation() {} - - public Microlocation(int id, String name) { - this.id = id; - this.name = name; - } - - public Microlocation(int id, String name, float latitude, float longitude, int floor, String room) { - this.id = id; - this.name = name; - this.latitude = latitude; - this.longitude = longitude; - this.floor = floor; - this.room = room; - } - - public int getId() { - return this.id; - } - - public String getName() { - return this.name; - } - - public float getLatitude() { - return this.latitude; - } - - public float getLongitude() { - return this.longitude; - } - - public int getFloor() { - return this.floor; - } - - public String getRoom() { - return this.room; - } - - public void setId(int id) { - this.id = id; - } - - public void setName(String name) { - this.name = name; - } - - public void setLatitude(float latitude) { - this.latitude = latitude; - } - - public void setLongitude(float longitude) { - this.longitude = longitude; - } - - public void setFloor(int floor) { - this.floor = floor; - } - - public void setRoom(String room) { - this.room = room; - } - - public String toString() { - return "Microlocation(id=" + this.getId() + ", name=" + this.getName() + ", latitude=" + this.getLatitude() + ", longitude=" + this.getLongitude() + ", floor=" + this.getFloor() + ", room=" + this.getRoom() + ")"; - } - - @Override - public boolean equals(Object o) { - if (o == this) return true; - if (!(o instanceof Microlocation)) return false; - final Microlocation other = (Microlocation) o; - if (!other.canEqual((Object) this)) return false; - if (this.getId() != other.getId()) return false; - final Object this$name = this.getName(); - final Object other$name = other.getName(); - if (this$name == null ? other$name != null : !this$name.equals(other$name)) return false; - if (Float.compare(this.getLatitude(), other.getLatitude()) != 0) return false; - if (Float.compare(this.getLongitude(), other.getLongitude()) != 0) return false; - if (this.getFloor() != other.getFloor()) return false; - final Object this$room = this.getRoom(); - final Object other$room = other.getRoom(); - if (this$room == null ? other$room != null : !this$room.equals(other$room)) return false; - return true; - } - - @Override - public int hashCode() { - final int PRIME = 59; - int result = 1; - result = result * PRIME + this.getId(); - final Object $name = this.getName(); - result = result * PRIME + ($name == null ? 43 : $name.hashCode()); - result = result * PRIME + Float.floatToIntBits(this.getLatitude()); - result = result * PRIME + Float.floatToIntBits(this.getLongitude()); - result = result * PRIME + this.getFloor(); - final Object $room = this.getRoom(); - result = result * PRIME + ($room == null ? 43 : $room.hashCode()); - return result; - } - - protected boolean canEqual(Object other) { - return other instanceof Microlocation; - } -} diff --git a/android/app/src/main/java/org/fossasia/openevent/data/Microlocation.kt b/android/app/src/main/java/org/fossasia/openevent/data/Microlocation.kt new file mode 100644 index 0000000000..483b78daee --- /dev/null +++ b/android/app/src/main/java/org/fossasia/openevent/data/Microlocation.kt @@ -0,0 +1,31 @@ +package org.fossasia.openevent.data + +import com.fasterxml.jackson.databind.PropertyNamingStrategy +import com.fasterxml.jackson.databind.annotation.JsonNaming +import com.github.jasminb.jsonapi.IntegerIdHandler +import com.github.jasminb.jsonapi.annotations.Id +import com.github.jasminb.jsonapi.annotations.Type + +import io.realm.RealmObject +import io.realm.annotations.PrimaryKey + +@Type("microlocation") +@JsonNaming(PropertyNamingStrategy.KebabCaseStrategy::class) +open class Microlocation( + @PrimaryKey + @Id(IntegerIdHandler::class) + var id: Int = 0, + var name: String? = null, + var latitude: Float = 0.toFloat(), + var longitude: Float = 0.toFloat(), + var floor: Int = 0, + var room: String? = null + +) : RealmObject() { + + constructor(id: Int, name: String) : this() { + this.id = id + this.name = name + } + +} diff --git a/android/app/src/main/java/org/fossasia/openevent/data/Notification.java b/android/app/src/main/java/org/fossasia/openevent/data/Notification.java deleted file mode 100644 index 46365c6be8..0000000000 --- a/android/app/src/main/java/org/fossasia/openevent/data/Notification.java +++ /dev/null @@ -1,118 +0,0 @@ -package org.fossasia.openevent.data; - -import com.fasterxml.jackson.databind.PropertyNamingStrategy; -import com.fasterxml.jackson.databind.annotation.JsonNaming; -import com.github.jasminb.jsonapi.IntegerIdHandler; -import com.github.jasminb.jsonapi.annotations.Id; -import com.github.jasminb.jsonapi.annotations.Type; - -import io.realm.RealmObject; -import io.realm.annotations.PrimaryKey; - -@Type("notification") -@JsonNaming(PropertyNamingStrategy.KebabCaseStrategy.class) -public class Notification extends RealmObject { - - @PrimaryKey - @Id(IntegerIdHandler.class) - private int id; - private String title; - private String message; - private boolean isRead; - private String receivedAt; - - public Notification(int id, String title, String message, boolean isRead, String receivedAt) { - this.id = id; - this.title = title; - this.message = message; - this.isRead = isRead; - this.receivedAt = receivedAt; - } - - public Notification() { - } - - public int getId() { - return this.id; - } - - public String getTitle() { - return this.title; - } - - public String getMessage() { - return this.message; - } - - public boolean getIsRead() { - return this.isRead; - } - - public String getReceivedAt() { - return this.receivedAt; - } - - public void setId(int id) { - this.id = id; - } - - public void setTitle(String title) { - this.title = title; - } - - public void setMessage(String message) { - this.message = message; - } - - public void setIsRead(boolean isRead) { - this.isRead = isRead; - } - - public void setReceivedAt(String receivedAt) { - this.receivedAt = receivedAt; - } - - public String toString() { - return "Notification(id=" + this.getId() + ", title=" + this.getTitle() + ", message=" + this.getMessage() + ", isRead=" + this.getIsRead() + ", receivedAt=" + this.getReceivedAt() + ")"; - } - - public boolean equals(Object o) { - if (o == this) return true; - if (!(o instanceof Notification)) return false; - final Notification other = (Notification) o; - if (!other.canEqual((Object) this)) return false; - if (this.getId() != other.getId()) return false; - final Object this$title = this.getTitle(); - final Object other$title = other.getTitle(); - if (this$title == null ? other$title != null : !this$title.equals(other$title)) - return false; - final Object this$message = this.getMessage(); - final Object other$message = other.getMessage(); - if (this$message == null ? other$message != null : !this$message.equals(other$message)) - return false; - if (this.getIsRead() != other.getIsRead()) return false; - final Object this$receivedAt = this.getReceivedAt(); - final Object other$receivedAt = other.getReceivedAt(); - if (this$receivedAt == null ? other$receivedAt != null : !this$receivedAt.equals(other$receivedAt)) - return false; - return true; - } - - public int hashCode() { - final int PRIME = 59; - int result = 1; - result = result * PRIME + this.getId(); - final Object $title = this.getTitle(); - result = result * PRIME + ($title == null ? 43 : $title.hashCode()); - final Object $message = this.getMessage(); - result = result * PRIME + ($message == null ? 43 : $message.hashCode()); - result = result * PRIME + (this.getIsRead() ? 79 : 97); - final Object $receivedAt = this.getReceivedAt(); - result = result * PRIME + ($receivedAt == null ? 43 : $receivedAt.hashCode()); - return result; - } - - protected boolean canEqual(Object other) { - return other instanceof Notification; - } -} diff --git a/android/app/src/main/java/org/fossasia/openevent/data/Notification.kt b/android/app/src/main/java/org/fossasia/openevent/data/Notification.kt new file mode 100644 index 0000000000..d65a228c31 --- /dev/null +++ b/android/app/src/main/java/org/fossasia/openevent/data/Notification.kt @@ -0,0 +1,22 @@ +package org.fossasia.openevent.data + +import com.fasterxml.jackson.databind.PropertyNamingStrategy +import com.fasterxml.jackson.databind.annotation.JsonNaming +import com.github.jasminb.jsonapi.IntegerIdHandler +import com.github.jasminb.jsonapi.annotations.Id +import com.github.jasminb.jsonapi.annotations.Type + +import io.realm.RealmObject +import io.realm.annotations.PrimaryKey + +@Type("notification") +@JsonNaming(PropertyNamingStrategy.KebabCaseStrategy::class) +open class Notification( + @PrimaryKey + @Id(IntegerIdHandler::class) + var id: Int = 0, + var title: String? = null, + var message: String? = null, + var isRead: Boolean = false, + var receivedAt: String? = null +) : RealmObject() diff --git a/android/app/src/main/java/org/fossasia/openevent/data/Session.java b/android/app/src/main/java/org/fossasia/openevent/data/Session.java deleted file mode 100644 index 8664db153c..0000000000 --- a/android/app/src/main/java/org/fossasia/openevent/data/Session.java +++ /dev/null @@ -1,422 +0,0 @@ -package org.fossasia.openevent.data; - -import com.fasterxml.jackson.databind.PropertyNamingStrategy; -import com.fasterxml.jackson.databind.annotation.JsonNaming; -import com.github.jasminb.jsonapi.IntegerIdHandler; -import com.github.jasminb.jsonapi.annotations.Id; -import com.github.jasminb.jsonapi.annotations.Relationship; -import com.github.jasminb.jsonapi.annotations.Type; - -import io.realm.RealmList; -import io.realm.RealmObject; -import io.realm.annotations.Index; -import io.realm.annotations.PrimaryKey; - -@Type("session") -@JsonNaming(PropertyNamingStrategy.KebabCaseStrategy.class) -public class Session extends RealmObject { - - /* Sort criteria */ - - public static final String TITLE = "title"; - // Track is object in Realm. So sort by track.name - public static final String TRACK = "track.name"; - public static final String START_TIME = "startsAt"; - - @PrimaryKey - @Id(IntegerIdHandler.class) - private int id; - @Index - private String title; - private String subtitle; - private String shortAbstract; - private String longAbstract; - private String comments; - private String startsAt; - private String endsAt; - private String language; - private String slidesUrl; - private String videoUrl; - private String audioUrl; - private String signupUrl; - private String state; - private String level; - @Index - private String startDate; - private boolean isBookmarked; - private String createdAt; - private String deletedAt; - private String submittedAt; - private boolean isMailSent; - @Relationship("session-type") - private SessionType sessionType; - @Relationship("track") - private Track track; - @Relationship("microlocation") - private Microlocation microlocation; - @Relationship("speakers") - private RealmList speakers; - - public Session() { - } - - public int getId() { - return this.id; - } - - public String getTitle() { - return this.title; - } - - public String getSubtitle() { - return this.subtitle; - } - - public String getShortAbstract() { - return this.shortAbstract; - } - - public String getLongAbstract() { - return this.longAbstract; - } - - public String getComments() { - return this.comments; - } - - public String getStartsAt() { - return this.startsAt; - } - - public String getEndsAt() { - return this.endsAt; - } - - public String getLanguage() { - return this.language; - } - - public String getSlidesUrl() { - return this.slidesUrl; - } - - public String getVideoUrl() { - return this.videoUrl; - } - - public String getAudioUrl() { - return this.audioUrl; - } - - public String getSignupUrl() { - return this.signupUrl; - } - - public String getState() { - return this.state; - } - - public String getLevel() { - return this.level; - } - - public String getStartDate() { - return this.startDate; - } - - public boolean getIsBookmarked() { - return this.isBookmarked; - } - - public String getCreatedAt() { - return this.createdAt; - } - - public String getDeletedAt() { - return this.deletedAt; - } - - public String getSubmittedAt() { - return this.submittedAt; - } - - public boolean getIsMailSent() { - return this.isMailSent; - } - - public SessionType getSessionType() { - return this.sessionType; - } - - public Track getTrack() { - return this.track; - } - - public Microlocation getMicrolocation() { - return this.microlocation; - } - - public RealmList getSpeakers() { - return this.speakers; - } - - public void setId(int id) { - this.id = id; - } - - public void setTitle(String title) { - this.title = title; - } - - public void setSubtitle(String subtitle) { - this.subtitle = subtitle; - } - - public void setShortAbstract(String shortAbstract) { - this.shortAbstract = shortAbstract; - } - - public void setLongAbstract(String longAbstract) { - this.longAbstract = longAbstract; - } - - public void setComments(String comments) { - this.comments = comments; - } - - public void setStartsAt(String startsAt) { - this.startsAt = startsAt; - } - - public void setEndsAt(String endsAt) { - this.endsAt = endsAt; - } - - public void setLanguage(String language) { - this.language = language; - } - - public void setSlidesUrl(String slidesUrl) { - this.slidesUrl = slidesUrl; - } - - public void setVideoUrl(String videoUrl) { - this.videoUrl = videoUrl; - } - - public void setAudioUrl(String audioUrl) { - this.audioUrl = audioUrl; - } - - public void setSignupUrl(String signupUrl) { - this.signupUrl = signupUrl; - } - - public void setState(String state) { - this.state = state; - } - - public void setLevel(String level) { - this.level = level; - } - - public void setStartDate(String startDate) { - this.startDate = startDate; - } - - public void setIsBookmarked(boolean isBookmarked) { - this.isBookmarked = isBookmarked; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public void setDeletedAt(String deletedAt) { - this.deletedAt = deletedAt; - } - - public void setSubmittedAt(String submittedAt) { - this.submittedAt = submittedAt; - } - - public void setIsMailSent(boolean isMailSent) { - this.isMailSent = isMailSent; - } - - public void setSessionType(SessionType sessionType) { - this.sessionType = sessionType; - } - - public void setTrack(Track track) { - this.track = track; - } - - public void setMicrolocation(Microlocation microlocation) { - this.microlocation = microlocation; - } - - public void setSpeakers(RealmList speakers) { - this.speakers = speakers; - } - - public boolean equals(Object o) { - if (o == this) return true; - if (!(o instanceof Session)) return false; - final Session other = (Session) o; - if (!other.canEqual((Object) this)) return false; - if (this.getId() != other.getId()) return false; - final Object this$title = this.getTitle(); - final Object other$title = other.getTitle(); - if (this$title == null ? other$title != null : !this$title.equals(other$title)) - return false; - final Object this$subtitle = this.getSubtitle(); - final Object other$subtitle = other.getSubtitle(); - if (this$subtitle == null ? other$subtitle != null : !this$subtitle.equals(other$subtitle)) - return false; - final Object this$shortAbstract = this.getShortAbstract(); - final Object other$shortAbstract = other.getShortAbstract(); - if (this$shortAbstract == null ? other$shortAbstract != null : !this$shortAbstract.equals(other$shortAbstract)) - return false; - final Object this$longAbstract = this.getLongAbstract(); - final Object other$longAbstract = other.getLongAbstract(); - if (this$longAbstract == null ? other$longAbstract != null : !this$longAbstract.equals(other$longAbstract)) - return false; - final Object this$comments = this.getComments(); - final Object other$comments = other.getComments(); - if (this$comments == null ? other$comments != null : !this$comments.equals(other$comments)) - return false; - final Object this$startsAt = this.getStartsAt(); - final Object other$startsAt = other.getStartsAt(); - if (this$startsAt == null ? other$startsAt != null : !this$startsAt.equals(other$startsAt)) - return false; - final Object this$endsAt = this.getEndsAt(); - final Object other$endsAt = other.getEndsAt(); - if (this$endsAt == null ? other$endsAt != null : !this$endsAt.equals(other$endsAt)) - return false; - final Object this$language = this.getLanguage(); - final Object other$language = other.getLanguage(); - if (this$language == null ? other$language != null : !this$language.equals(other$language)) - return false; - final Object this$slidesUrl = this.getSlidesUrl(); - final Object other$slidesUrl = other.getSlidesUrl(); - if (this$slidesUrl == null ? other$slidesUrl != null : !this$slidesUrl.equals(other$slidesUrl)) - return false; - final Object this$videoUrl = this.getVideoUrl(); - final Object other$videoUrl = other.getVideoUrl(); - if (this$videoUrl == null ? other$videoUrl != null : !this$videoUrl.equals(other$videoUrl)) - return false; - final Object this$audioUrl = this.getAudioUrl(); - final Object other$audioUrl = other.getAudioUrl(); - if (this$audioUrl == null ? other$audioUrl != null : !this$audioUrl.equals(other$audioUrl)) - return false; - final Object this$signupUrl = this.getSignupUrl(); - final Object other$signupUrl = other.getSignupUrl(); - if (this$signupUrl == null ? other$signupUrl != null : !this$signupUrl.equals(other$signupUrl)) - return false; - final Object this$state = this.getState(); - final Object other$state = other.getState(); - if (this$state == null ? other$state != null : !this$state.equals(other$state)) - return false; - final Object this$level = this.getLevel(); - final Object other$level = other.getLevel(); - if (this$level == null ? other$level != null : !this$level.equals(other$level)) - return false; - final Object this$startDate = this.getStartDate(); - final Object other$startDate = other.getStartDate(); - if (this$startDate == null ? other$startDate != null : !this$startDate.equals(other$startDate)) - return false; - if (this.getIsBookmarked() != other.getIsBookmarked()) return false; - final Object this$createdAt = this.getCreatedAt(); - final Object other$createdAt = other.getCreatedAt(); - if (this$createdAt == null ? other$createdAt != null : !this$createdAt.equals(other$createdAt)) - return false; - final Object this$deletedAt = this.getDeletedAt(); - final Object other$deletedAt = other.getDeletedAt(); - if (this$deletedAt == null ? other$deletedAt != null : !this$deletedAt.equals(other$deletedAt)) - return false; - final Object this$submittedAt = this.getSubmittedAt(); - final Object other$submittedAt = other.getSubmittedAt(); - if (this$submittedAt == null ? other$submittedAt != null : !this$submittedAt.equals(other$submittedAt)) - return false; - if (this.getIsMailSent() != other.getIsMailSent()) return false; - final Object this$sessionType = this.getSessionType(); - final Object other$sessionType = other.getSessionType(); - if (this$sessionType == null ? other$sessionType != null : !this$sessionType.equals(other$sessionType)) - return false; - final Object this$track = this.getTrack(); - final Object other$track = other.getTrack(); - if (this$track == null ? other$track != null : !this$track.equals(other$track)) - return false; - final Object this$microlocation = this.getMicrolocation(); - final Object other$microlocation = other.getMicrolocation(); - if (this$microlocation == null ? other$microlocation != null : !this$microlocation.equals(other$microlocation)) - return false; - final Object this$speakers = this.getSpeakers(); - final Object other$speakers = other.getSpeakers(); - if (this$speakers == null ? other$speakers != null : !this$speakers.equals(other$speakers)) - return false; - return true; - } - - public int hashCode() { - final int PRIME = 59; - int result = 1; - result = result * PRIME + this.getId(); - final Object $title = this.getTitle(); - result = result * PRIME + ($title == null ? 43 : $title.hashCode()); - final Object $subtitle = this.getSubtitle(); - result = result * PRIME + ($subtitle == null ? 43 : $subtitle.hashCode()); - final Object $shortAbstract = this.getShortAbstract(); - result = result * PRIME + ($shortAbstract == null ? 43 : $shortAbstract.hashCode()); - final Object $longAbstract = this.getLongAbstract(); - result = result * PRIME + ($longAbstract == null ? 43 : $longAbstract.hashCode()); - final Object $comments = this.getComments(); - result = result * PRIME + ($comments == null ? 43 : $comments.hashCode()); - final Object $startsAt = this.getStartsAt(); - result = result * PRIME + ($startsAt == null ? 43 : $startsAt.hashCode()); - final Object $endsAt = this.getEndsAt(); - result = result * PRIME + ($endsAt == null ? 43 : $endsAt.hashCode()); - final Object $language = this.getLanguage(); - result = result * PRIME + ($language == null ? 43 : $language.hashCode()); - final Object $slidesUrl = this.getSlidesUrl(); - result = result * PRIME + ($slidesUrl == null ? 43 : $slidesUrl.hashCode()); - final Object $videoUrl = this.getVideoUrl(); - result = result * PRIME + ($videoUrl == null ? 43 : $videoUrl.hashCode()); - final Object $audioUrl = this.getAudioUrl(); - result = result * PRIME + ($audioUrl == null ? 43 : $audioUrl.hashCode()); - final Object $signupUrl = this.getSignupUrl(); - result = result * PRIME + ($signupUrl == null ? 43 : $signupUrl.hashCode()); - final Object $state = this.getState(); - result = result * PRIME + ($state == null ? 43 : $state.hashCode()); - final Object $level = this.getLevel(); - result = result * PRIME + ($level == null ? 43 : $level.hashCode()); - final Object $startDate = this.getStartDate(); - result = result * PRIME + ($startDate == null ? 43 : $startDate.hashCode()); - result = result * PRIME + (this.getIsBookmarked() ? 79 : 97); - final Object $createdAt = this.getCreatedAt(); - result = result * PRIME + ($createdAt == null ? 43 : $createdAt.hashCode()); - final Object $deletedAt = this.getDeletedAt(); - result = result * PRIME + ($deletedAt == null ? 43 : $deletedAt.hashCode()); - final Object $submittedAt = this.getSubmittedAt(); - result = result * PRIME + ($submittedAt == null ? 43 : $submittedAt.hashCode()); - result = result * PRIME + (this.getIsMailSent() ? 79 : 97); - final Object $sessionType = this.getSessionType(); - result = result * PRIME + ($sessionType == null ? 43 : $sessionType.hashCode()); - final Object $track = this.getTrack(); - result = result * PRIME + ($track == null ? 43 : $track.hashCode()); - final Object $microlocation = this.getMicrolocation(); - result = result * PRIME + ($microlocation == null ? 43 : $microlocation.hashCode()); - final Object $speakers = this.getSpeakers(); - result = result * PRIME + ($speakers == null ? 43 : $speakers.hashCode()); - return result; - } - - protected boolean canEqual(Object other) { - return other instanceof Session; - } - - public String toString() { - return "Session(id=" + this.getId() + ", title=" + this.getTitle() + ")"; - } -} \ No newline at end of file diff --git a/android/app/src/main/java/org/fossasia/openevent/data/Session.kt b/android/app/src/main/java/org/fossasia/openevent/data/Session.kt new file mode 100644 index 0000000000..9c1f117d0f --- /dev/null +++ b/android/app/src/main/java/org/fossasia/openevent/data/Session.kt @@ -0,0 +1,62 @@ +package org.fossasia.openevent.data + +import com.fasterxml.jackson.databind.PropertyNamingStrategy +import com.fasterxml.jackson.databind.annotation.JsonNaming +import com.github.jasminb.jsonapi.IntegerIdHandler +import com.github.jasminb.jsonapi.annotations.Id +import com.github.jasminb.jsonapi.annotations.Relationship +import com.github.jasminb.jsonapi.annotations.Type + +import io.realm.RealmList +import io.realm.RealmObject +import io.realm.annotations.Index +import io.realm.annotations.PrimaryKey + +@Type("session") +@JsonNaming(PropertyNamingStrategy.KebabCaseStrategy::class) +open class Session( + @PrimaryKey + @Id(IntegerIdHandler::class) + var id: Int = 0, + @Index + var title: String? = null, + var subtitle: String? = null, + var shortAbstract: String? = null, + var longAbstract: String? = null, + var comments: String? = null, + var startsAt: String? = null, + var endsAt: String? = null, + var language: String? = null, + var slidesUrl: String? = null, + var videoUrl: String? = null, + var audioUrl: String? = null, + var signupUrl: String? = null, + var state: String? = null, + var level: String? = null, + @Index + var startDate: String? = null, + var isBookmarked: Boolean = false, + var createdAt: String? = null, + var deletedAt: String? = null, + var submittedAt: String? = null, + var isMailSent: Boolean = false, + @Relationship("session-type") + var sessionType: SessionType? = null, + @Relationship("track") + var track: Track? = null, + @Relationship("microlocation") + var microlocation: Microlocation? = null, + @Relationship("speakers") + var speakers: RealmList? = null +) : RealmObject() { + + companion object { + + /* Sort criteria */ + + val TITLE = "title" + // Track is object in Realm. So sort by track.name + val TRACK = "track.name" + val START_TIME = "startsAt" + } +} \ No newline at end of file diff --git a/android/app/src/main/java/org/fossasia/openevent/data/SessionType.java b/android/app/src/main/java/org/fossasia/openevent/data/SessionType.java deleted file mode 100644 index 9beaf9aaf7..0000000000 --- a/android/app/src/main/java/org/fossasia/openevent/data/SessionType.java +++ /dev/null @@ -1,83 +0,0 @@ -package org.fossasia.openevent.data; - -import com.fasterxml.jackson.databind.PropertyNamingStrategy; -import com.fasterxml.jackson.databind.annotation.JsonNaming; -import com.github.jasminb.jsonapi.IntegerIdHandler; -import com.github.jasminb.jsonapi.annotations.Id; -import com.github.jasminb.jsonapi.annotations.Type; - -import io.realm.RealmObject; -import io.realm.annotations.PrimaryKey; - -@Type("session-type") -@JsonNaming(PropertyNamingStrategy.KebabCaseStrategy.class) -public class SessionType extends RealmObject { - - @PrimaryKey - @Id(IntegerIdHandler.class) - private int id; - private String length; - private String name; - - public SessionType() { - } - - public int getId() { - return this.id; - } - - public String getLength() { - return this.length; - } - - public String getName() { - return this.name; - } - - public void setId(int id) { - this.id = id; - } - - public void setLength(String length) { - this.length = length; - } - - public void setName(String name) { - this.name = name; - } - - public String toString() { - return "SessionType(id=" + this.getId() + ", length=" + this.getLength() + ", name=" + this.getName() + ")"; - } - - public boolean equals(Object o) { - if (o == this) return true; - if (!(o instanceof SessionType)) return false; - final SessionType other = (SessionType) o; - if (!other.canEqual((Object) this)) return false; - if (this.getId() != other.getId()) return false; - final Object this$length = this.getLength(); - final Object other$length = other.getLength(); - if (this$length == null ? other$length != null : !this$length.equals(other$length)) - return false; - final Object this$name = this.getName(); - final Object other$name = other.getName(); - if (this$name == null ? other$name != null : !this$name.equals(other$name)) return false; - return true; - } - - public int hashCode() { - final int PRIME = 59; - int result = 1; - result = result * PRIME + this.getId(); - final Object $length = this.getLength(); - result = result * PRIME + ($length == null ? 43 : $length.hashCode()); - final Object $name = this.getName(); - result = result * PRIME + ($name == null ? 43 : $name.hashCode()); - return result; - } - - protected boolean canEqual(Object other) { - return other instanceof SessionType; - } -} diff --git a/android/app/src/main/java/org/fossasia/openevent/data/SessionType.kt b/android/app/src/main/java/org/fossasia/openevent/data/SessionType.kt new file mode 100644 index 0000000000..96232f52da --- /dev/null +++ b/android/app/src/main/java/org/fossasia/openevent/data/SessionType.kt @@ -0,0 +1,20 @@ +package org.fossasia.openevent.data + +import com.fasterxml.jackson.databind.PropertyNamingStrategy +import com.fasterxml.jackson.databind.annotation.JsonNaming +import com.github.jasminb.jsonapi.IntegerIdHandler +import com.github.jasminb.jsonapi.annotations.Id +import com.github.jasminb.jsonapi.annotations.Type + +import io.realm.RealmObject +import io.realm.annotations.PrimaryKey + +@Type("session-type") +@JsonNaming(PropertyNamingStrategy.KebabCaseStrategy::class) +open class SessionType( + @PrimaryKey + @Id(IntegerIdHandler::class) + var id: Int = 0, + var length: String? = null, + var name: String? = null +) : RealmObject() diff --git a/android/app/src/main/java/org/fossasia/openevent/data/Speaker.java b/android/app/src/main/java/org/fossasia/openevent/data/Speaker.java deleted file mode 100644 index b9fe5a5542..0000000000 --- a/android/app/src/main/java/org/fossasia/openevent/data/Speaker.java +++ /dev/null @@ -1,420 +0,0 @@ -package org.fossasia.openevent.data; - -import com.fasterxml.jackson.databind.PropertyNamingStrategy; -import com.fasterxml.jackson.databind.annotation.JsonNaming; -import com.github.jasminb.jsonapi.IntegerIdHandler; -import com.github.jasminb.jsonapi.annotations.Id; -import com.github.jasminb.jsonapi.annotations.Relationship; -import com.github.jasminb.jsonapi.annotations.Type; - -import io.realm.RealmList; -import io.realm.RealmObject; -import io.realm.annotations.Index; -import io.realm.annotations.PrimaryKey; - -@Type("speaker") -@JsonNaming(PropertyNamingStrategy.KebabCaseStrategy.class) -public class Speaker extends RealmObject { - - public static final String SPEAKER = "speaker"; - public static final String NAME = "name"; - public static final String ORGANISATION = "organisation"; - public static final String COUNTRY = "country"; - - @PrimaryKey - @Id(IntegerIdHandler.class) - private int id; - @Index - private String name; - @Index - private String country; - @Index - private String email; - private String organisation; - private String photoUrl; - private String thumbnailImageUrl; - private String smallImageUrl; - private String iconImageUrl; - private String twitter; - private String linkedin; - private String facebook; - private String github; - private String mobile; - private String website; - private boolean isFeatured; - private String city; - private String longBiography; - private String shortBiography; - private String speakingExperience; - private String gender; - private String position; - private String heardFrom; - private String sponsorshipRequired; - @Relationship("sessions") - private RealmList sessions; - - public Speaker() { - } - - public int getId() { - return this.id; - } - - public String getName() { - return this.name; - } - - public String getCountry() { - return this.country; - } - - public String getEmail() { - return this.email; - } - - public String getOrganisation() { - return this.organisation; - } - - public String getPhotoUrl() { - return this.photoUrl; - } - - public String getThumbnailImageUrl() { - return this.thumbnailImageUrl; - } - - public String getSmallImageUrl() { - return this.smallImageUrl; - } - - public String getIconImageUrl() { - return this.iconImageUrl; - } - - public String getTwitter() { - return this.twitter; - } - - public String getLinkedin() { - return this.linkedin; - } - - public String getFacebook() { - return this.facebook; - } - - public String getGithub() { - return this.github; - } - - public String getMobile() { - return this.mobile; - } - - public String getWebsite() { - return this.website; - } - - public boolean getIsFeatured() { - return this.isFeatured; - } - - public String getCity() { - return this.city; - } - - public String getLongBiography() { - return this.longBiography; - } - - public String getShortBiography() { - return this.shortBiography; - } - - public String getSpeakingExperience() { - return this.speakingExperience; - } - - public String getGender() { - return this.gender; - } - - public String getPosition() { - return this.position; - } - - public String getHeardFrom() { - return this.heardFrom; - } - - public String getSponsorshipRequired() { - return this.sponsorshipRequired; - } - - public RealmList getSessions() { - return this.sessions; - } - - public void setId(int id) { - this.id = id; - } - - public void setName(String name) { - this.name = name; - } - - public void setCountry(String country) { - this.country = country; - } - - public void setEmail(String email) { - this.email = email; - } - - public void setOrganisation(String organisation) { - this.organisation = organisation; - } - - public void setPhotoUrl(String photoUrl) { - this.photoUrl = photoUrl; - } - - public void setThumbnailImageUrl(String thumbnailImageUrl) { - this.thumbnailImageUrl = thumbnailImageUrl; - } - - public void setSmallImageUrl(String smallImageUrl) { - this.smallImageUrl = smallImageUrl; - } - - public void setIconImageUrl(String iconImageUrl) { - this.iconImageUrl = iconImageUrl; - } - - public void setTwitter(String twitter) { - this.twitter = twitter; - } - - public void setLinkedin(String linkedin) { - this.linkedin = linkedin; - } - - public void setFacebook(String facebook) { - this.facebook = facebook; - } - - public void setGithub(String github) { - this.github = github; - } - - public void setMobile(String mobile) { - this.mobile = mobile; - } - - public void setWebsite(String website) { - this.website = website; - } - - public void setIsFeatured(boolean isFeatured) { - this.isFeatured = isFeatured; - } - - public void setCity(String city) { - this.city = city; - } - - public void setLongBiography(String longBiography) { - this.longBiography = longBiography; - } - - public void setShortBiography(String shortBiography) { - this.shortBiography = shortBiography; - } - - public void setSpeakingExperience(String speakingExperience) { - this.speakingExperience = speakingExperience; - } - - public void setGender(String gender) { - this.gender = gender; - } - - public void setPosition(String position) { - this.position = position; - } - - public void setHeardFrom(String heardFrom) { - this.heardFrom = heardFrom; - } - - public void setSponsorshipRequired(String sponsorshipRequired) { - this.sponsorshipRequired = sponsorshipRequired; - } - - public void setSessions(RealmList sessions) { - this.sessions = sessions; - } - - public boolean equals(Object o) { - if (o == this) return true; - if (!(o instanceof Speaker)) return false; - final Speaker other = (Speaker) o; - if (!other.canEqual((Object) this)) return false; - if (this.getId() != other.getId()) return false; - final Object this$name = this.getName(); - final Object other$name = other.getName(); - if (this$name == null ? other$name != null : !this$name.equals(other$name)) return false; - final Object this$country = this.getCountry(); - final Object other$country = other.getCountry(); - if (this$country == null ? other$country != null : !this$country.equals(other$country)) - return false; - final Object this$email = this.getEmail(); - final Object other$email = other.getEmail(); - if (this$email == null ? other$email != null : !this$email.equals(other$email)) - return false; - final Object this$organisation = this.getOrganisation(); - final Object other$organisation = other.getOrganisation(); - if (this$organisation == null ? other$organisation != null : !this$organisation.equals(other$organisation)) - return false; - final Object this$photoUrl = this.getPhotoUrl(); - final Object other$photoUrl = other.getPhotoUrl(); - if (this$photoUrl == null ? other$photoUrl != null : !this$photoUrl.equals(other$photoUrl)) - return false; - final Object this$thumbnailImageUrl = this.getThumbnailImageUrl(); - final Object other$thumbnailImageUrl = other.getThumbnailImageUrl(); - if (this$thumbnailImageUrl == null ? other$thumbnailImageUrl != null : !this$thumbnailImageUrl.equals(other$thumbnailImageUrl)) - return false; - final Object this$smallImageUrl = this.getSmallImageUrl(); - final Object other$smallImageUrl = other.getSmallImageUrl(); - if (this$smallImageUrl == null ? other$smallImageUrl != null : !this$smallImageUrl.equals(other$smallImageUrl)) - return false; - final Object this$iconImageUrl = this.getIconImageUrl(); - final Object other$iconImageUrl = other.getIconImageUrl(); - if (this$iconImageUrl == null ? other$iconImageUrl != null : !this$iconImageUrl.equals(other$iconImageUrl)) - return false; - final Object this$twitter = this.getTwitter(); - final Object other$twitter = other.getTwitter(); - if (this$twitter == null ? other$twitter != null : !this$twitter.equals(other$twitter)) - return false; - final Object this$linkedin = this.getLinkedin(); - final Object other$linkedin = other.getLinkedin(); - if (this$linkedin == null ? other$linkedin != null : !this$linkedin.equals(other$linkedin)) - return false; - final Object this$facebook = this.getFacebook(); - final Object other$facebook = other.getFacebook(); - if (this$facebook == null ? other$facebook != null : !this$facebook.equals(other$facebook)) - return false; - final Object this$github = this.getGithub(); - final Object other$github = other.getGithub(); - if (this$github == null ? other$github != null : !this$github.equals(other$github)) - return false; - final Object this$mobile = this.getMobile(); - final Object other$mobile = other.getMobile(); - if (this$mobile == null ? other$mobile != null : !this$mobile.equals(other$mobile)) - return false; - final Object this$website = this.getWebsite(); - final Object other$website = other.getWebsite(); - if (this$website == null ? other$website != null : !this$website.equals(other$website)) - return false; - if (this.getIsFeatured() != other.getIsFeatured()) return false; - final Object this$city = this.getCity(); - final Object other$city = other.getCity(); - if (this$city == null ? other$city != null : !this$city.equals(other$city)) return false; - final Object this$longBiography = this.getLongBiography(); - final Object other$longBiography = other.getLongBiography(); - if (this$longBiography == null ? other$longBiography != null : !this$longBiography.equals(other$longBiography)) - return false; - final Object this$shortBiography = this.getShortBiography(); - final Object other$shortBiography = other.getShortBiography(); - if (this$shortBiography == null ? other$shortBiography != null : !this$shortBiography.equals(other$shortBiography)) - return false; - final Object this$speakingExperience = this.getSpeakingExperience(); - final Object other$speakingExperience = other.getSpeakingExperience(); - if (this$speakingExperience == null ? other$speakingExperience != null : !this$speakingExperience.equals(other$speakingExperience)) - return false; - final Object this$gender = this.getGender(); - final Object other$gender = other.getGender(); - if (this$gender == null ? other$gender != null : !this$gender.equals(other$gender)) - return false; - final Object this$position = this.getPosition(); - final Object other$position = other.getPosition(); - if (this$position == null ? other$position != null : !this$position.equals(other$position)) - return false; - final Object this$heardFrom = this.getHeardFrom(); - final Object other$heardFrom = other.getHeardFrom(); - if (this$heardFrom == null ? other$heardFrom != null : !this$heardFrom.equals(other$heardFrom)) - return false; - final Object this$sponsorshipRequired = this.getSponsorshipRequired(); - final Object other$sponsorshipRequired = other.getSponsorshipRequired(); - if (this$sponsorshipRequired == null ? other$sponsorshipRequired != null : !this$sponsorshipRequired.equals(other$sponsorshipRequired)) - return false; - final Object this$sessions = this.getSessions(); - final Object other$sessions = other.getSessions(); - if (this$sessions == null ? other$sessions != null : !this$sessions.equals(other$sessions)) - return false; - return true; - } - - public int hashCode() { - final int PRIME = 59; - int result = 1; - result = result * PRIME + this.getId(); - final Object $name = this.getName(); - result = result * PRIME + ($name == null ? 43 : $name.hashCode()); - final Object $country = this.getCountry(); - result = result * PRIME + ($country == null ? 43 : $country.hashCode()); - final Object $email = this.getEmail(); - result = result * PRIME + ($email == null ? 43 : $email.hashCode()); - final Object $organisation = this.getOrganisation(); - result = result * PRIME + ($organisation == null ? 43 : $organisation.hashCode()); - final Object $photoUrl = this.getPhotoUrl(); - result = result * PRIME + ($photoUrl == null ? 43 : $photoUrl.hashCode()); - final Object $thumbnailImageUrl = this.getThumbnailImageUrl(); - result = result * PRIME + ($thumbnailImageUrl == null ? 43 : $thumbnailImageUrl.hashCode()); - final Object $smallImageUrl = this.getSmallImageUrl(); - result = result * PRIME + ($smallImageUrl == null ? 43 : $smallImageUrl.hashCode()); - final Object $iconImageUrl = this.getIconImageUrl(); - result = result * PRIME + ($iconImageUrl == null ? 43 : $iconImageUrl.hashCode()); - final Object $twitter = this.getTwitter(); - result = result * PRIME + ($twitter == null ? 43 : $twitter.hashCode()); - final Object $linkedin = this.getLinkedin(); - result = result * PRIME + ($linkedin == null ? 43 : $linkedin.hashCode()); - final Object $facebook = this.getFacebook(); - result = result * PRIME + ($facebook == null ? 43 : $facebook.hashCode()); - final Object $github = this.getGithub(); - result = result * PRIME + ($github == null ? 43 : $github.hashCode()); - final Object $mobile = this.getMobile(); - result = result * PRIME + ($mobile == null ? 43 : $mobile.hashCode()); - final Object $website = this.getWebsite(); - result = result * PRIME + ($website == null ? 43 : $website.hashCode()); - result = result * PRIME + (this.getIsFeatured() ? 79 : 97); - final Object $city = this.getCity(); - result = result * PRIME + ($city == null ? 43 : $city.hashCode()); - final Object $longBiography = this.getLongBiography(); - result = result * PRIME + ($longBiography == null ? 43 : $longBiography.hashCode()); - final Object $shortBiography = this.getShortBiography(); - result = result * PRIME + ($shortBiography == null ? 43 : $shortBiography.hashCode()); - final Object $speakingExperience = this.getSpeakingExperience(); - result = result * PRIME + ($speakingExperience == null ? 43 : $speakingExperience.hashCode()); - final Object $gender = this.getGender(); - result = result * PRIME + ($gender == null ? 43 : $gender.hashCode()); - final Object $position = this.getPosition(); - result = result * PRIME + ($position == null ? 43 : $position.hashCode()); - final Object $heardFrom = this.getHeardFrom(); - result = result * PRIME + ($heardFrom == null ? 43 : $heardFrom.hashCode()); - final Object $sponsorshipRequired = this.getSponsorshipRequired(); - result = result * PRIME + ($sponsorshipRequired == null ? 43 : $sponsorshipRequired.hashCode()); - final Object $sessions = this.getSessions(); - result = result * PRIME + ($sessions == null ? 43 : $sessions.hashCode()); - return result; - } - - protected boolean canEqual(Object other) { - return other instanceof Speaker; - } - - public String toString() { - return "Speaker(id=" + this.getId() + ", name=" + this.getName() + ")"; - } -} \ No newline at end of file diff --git a/android/app/src/main/java/org/fossasia/openevent/data/Speaker.kt b/android/app/src/main/java/org/fossasia/openevent/data/Speaker.kt new file mode 100644 index 0000000000..92265392fc --- /dev/null +++ b/android/app/src/main/java/org/fossasia/openevent/data/Speaker.kt @@ -0,0 +1,58 @@ +package org.fossasia.openevent.data + +import com.fasterxml.jackson.databind.PropertyNamingStrategy +import com.fasterxml.jackson.databind.annotation.JsonNaming +import com.github.jasminb.jsonapi.IntegerIdHandler +import com.github.jasminb.jsonapi.annotations.Id +import com.github.jasminb.jsonapi.annotations.Relationship +import com.github.jasminb.jsonapi.annotations.Type + +import io.realm.RealmList +import io.realm.RealmObject +import io.realm.annotations.Index +import io.realm.annotations.PrimaryKey + +@Type("speaker") +@JsonNaming(PropertyNamingStrategy.KebabCaseStrategy::class) +open class Speaker( + @PrimaryKey + @Id(IntegerIdHandler::class) + var id: Int = 0, + @Index + var name: String? = null, + @Index + var country: String? = null, + @Index + var email: String? = null, + var organisation: String? = null, + var photoUrl: String? = null, + var thumbnailImageUrl: String? = null, + var smallImageUrl: String? = null, + var iconImageUrl: String? = null, + var twitter: String? = null, + var linkedin: String? = null, + var facebook: String? = null, + var github: String? = null, + var mobile: String? = null, + var website: String? = null, + var isFeatured: Boolean = false, + var city: String? = null, + var longBiography: String? = null, + var shortBiography: String? = null, + var speakingExperience: String? = null, + var gender: String? = null, + var position: String? = null, + var heardFrom: String? = null, + var sponsorshipRequired: String? = null, + @Relationship("sessions") + var sessions: RealmList? = null +) : RealmObject() { + + companion object { + + val SPEAKER = "speaker" + val NAME = "name" + val ORGANISATION = "organisation" + val COUNTRY = "country" + } +} \ No newline at end of file diff --git a/android/app/src/main/java/org/fossasia/openevent/data/Sponsor.java b/android/app/src/main/java/org/fossasia/openevent/data/Sponsor.java deleted file mode 100644 index d440c5dfdf..0000000000 --- a/android/app/src/main/java/org/fossasia/openevent/data/Sponsor.java +++ /dev/null @@ -1,141 +0,0 @@ -package org.fossasia.openevent.data; - -import com.fasterxml.jackson.databind.PropertyNamingStrategy; -import com.fasterxml.jackson.databind.annotation.JsonNaming; -import com.github.jasminb.jsonapi.IntegerIdHandler; -import com.github.jasminb.jsonapi.annotations.Id; -import com.github.jasminb.jsonapi.annotations.Type; - -import io.realm.RealmObject; -import io.realm.annotations.PrimaryKey; - -@Type("sponsor") -@JsonNaming(PropertyNamingStrategy.KebabCaseStrategy.class) -public class Sponsor extends RealmObject { - - @PrimaryKey - @Id(IntegerIdHandler.class) - private int id; - private String name; - private String description; - private String level; - private String url; - private String type; - private String logoUrl; - - public Sponsor() { - } - - public int getId() { - return this.id; - } - - public String getName() { - return this.name; - } - - public String getDescription() { - return this.description; - } - - public String getLevel() { - return this.level; - } - - public String getUrl() { - return this.url; - } - - public String getType() { - return this.type; - } - - public String getLogoUrl() { - return this.logoUrl; - } - - public void setId(int id) { - this.id = id; - } - - public void setName(String name) { - this.name = name; - } - - public void setDescription(String description) { - this.description = description; - } - - public void setLevel(String level) { - this.level = level; - } - - public void setUrl(String url) { - this.url = url; - } - - public void setType(String type) { - this.type = type; - } - - public void setLogoUrl(String logoUrl) { - this.logoUrl = logoUrl; - } - - public String toString() { - return "Sponsor(id=" + this.getId() + ", name=" + this.getName() + ", description=" + this.getDescription() + ", level=" + this.getLevel() + ", url=" + this.getUrl() + ", type=" + this.getType() + ", logoUrl=" + this.getLogoUrl() + ")"; - } - - public boolean equals(Object o) { - if (o == this) return true; - if (!(o instanceof Sponsor)) return false; - final Sponsor other = (Sponsor) o; - if (!other.canEqual((Object) this)) return false; - if (this.getId() != other.getId()) return false; - final Object this$name = this.getName(); - final Object other$name = other.getName(); - if (this$name == null ? other$name != null : !this$name.equals(other$name)) return false; - final Object this$description = this.getDescription(); - final Object other$description = other.getDescription(); - if (this$description == null ? other$description != null : !this$description.equals(other$description)) - return false; - final Object this$level = this.getLevel(); - final Object other$level = other.getLevel(); - if (this$level == null ? other$level != null : !this$level.equals(other$level)) - return false; - final Object this$url = this.getUrl(); - final Object other$url = other.getUrl(); - if (this$url == null ? other$url != null : !this$url.equals(other$url)) 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$logoUrl = this.getLogoUrl(); - final Object other$logoUrl = other.getLogoUrl(); - if (this$logoUrl == null ? other$logoUrl != null : !this$logoUrl.equals(other$logoUrl)) - return false; - return true; - } - - public int hashCode() { - final int PRIME = 59; - int result = 1; - result = result * PRIME + this.getId(); - final Object $name = this.getName(); - result = result * PRIME + ($name == null ? 43 : $name.hashCode()); - final Object $description = this.getDescription(); - result = result * PRIME + ($description == null ? 43 : $description.hashCode()); - final Object $level = this.getLevel(); - result = result * PRIME + ($level == null ? 43 : $level.hashCode()); - final Object $url = this.getUrl(); - result = result * PRIME + ($url == null ? 43 : $url.hashCode()); - final Object $type = this.getType(); - result = result * PRIME + ($type == null ? 43 : $type.hashCode()); - final Object $logoUrl = this.getLogoUrl(); - result = result * PRIME + ($logoUrl == null ? 43 : $logoUrl.hashCode()); - return result; - } - - protected boolean canEqual(Object other) { - return other instanceof Sponsor; - } -} \ No newline at end of file diff --git a/android/app/src/main/java/org/fossasia/openevent/data/Sponsor.kt b/android/app/src/main/java/org/fossasia/openevent/data/Sponsor.kt new file mode 100644 index 0000000000..f5730eb8c6 --- /dev/null +++ b/android/app/src/main/java/org/fossasia/openevent/data/Sponsor.kt @@ -0,0 +1,24 @@ +package org.fossasia.openevent.data + +import com.fasterxml.jackson.databind.PropertyNamingStrategy +import com.fasterxml.jackson.databind.annotation.JsonNaming +import com.github.jasminb.jsonapi.IntegerIdHandler +import com.github.jasminb.jsonapi.annotations.Id +import com.github.jasminb.jsonapi.annotations.Type + +import io.realm.RealmObject +import io.realm.annotations.PrimaryKey + +@Type("sponsor") +@JsonNaming(PropertyNamingStrategy.KebabCaseStrategy::class) +open class Sponsor( + @PrimaryKey + @Id(IntegerIdHandler::class) + var id: Int = 0, + var name: String? = null, + var description: String? = null, + var level: String? = null, + var url: String? = null, + var type: String? = null, + var logoUrl: String? = null +) : RealmObject() \ No newline at end of file diff --git a/android/app/src/main/java/org/fossasia/openevent/data/Track.java b/android/app/src/main/java/org/fossasia/openevent/data/Track.java deleted file mode 100644 index 7f8716b424..0000000000 --- a/android/app/src/main/java/org/fossasia/openevent/data/Track.java +++ /dev/null @@ -1,135 +0,0 @@ -package org.fossasia.openevent.data; - -import com.fasterxml.jackson.databind.PropertyNamingStrategy; -import com.fasterxml.jackson.databind.annotation.JsonNaming; -import com.github.jasminb.jsonapi.IntegerIdHandler; -import com.github.jasminb.jsonapi.annotations.Id; -import com.github.jasminb.jsonapi.annotations.Relationship; -import com.github.jasminb.jsonapi.annotations.Type; - -import io.realm.RealmList; -import io.realm.RealmObject; -import io.realm.annotations.Index; -import io.realm.annotations.PrimaryKey; - -@Type("track") -@JsonNaming(PropertyNamingStrategy.KebabCaseStrategy.class) -public class Track extends RealmObject { - - @PrimaryKey - @Id(IntegerIdHandler.class) - private int id; - @Index - private String name; - private String description; - private String color; - private String fontColor; - @Relationship("sessions") - private RealmList sessions; - - public Track() { - } - - public int getId() { - return this.id; - } - - public String getName() { - return this.name; - } - - public String getDescription() { - return this.description; - } - - public String getColor() { - return this.color; - } - - public String getFontColor() { - return this.fontColor; - } - - public RealmList getSessions() { - return this.sessions; - } - - public void setId(int id) { - this.id = id; - } - - public void setName(String name) { - this.name = name; - } - - public void setDescription(String description) { - this.description = description; - } - - public void setColor(String color) { - this.color = color; - } - - public void setFontColor(String fontColor) { - this.fontColor = fontColor; - } - - public void setSessions(RealmList sessions) { - this.sessions = sessions; - } - - public String toString() { - return "Track(id=" + this.getId() + ", name=" + this.getName() + ", description=" + this.getDescription() + ", color=" + this.getColor() + ", fontColor=" + this.getFontColor() + ", sessions=" + this.getSessions() + ")"; - } - - public boolean equals(Object o) { - if (o == this) return true; - if (!(o instanceof Track)) return false; - final Track other = (Track) o; - if (!other.canEqual((Object) this)) return false; - if (!super.equals(o)) return false; - if (this.getId() != other.getId()) return false; - final Object this$name = this.getName(); - final Object other$name = other.getName(); - if (this$name == null ? other$name != null : !this$name.equals(other$name)) return false; - final Object this$description = this.getDescription(); - final Object other$description = other.getDescription(); - if (this$description == null ? other$description != null : !this$description.equals(other$description)) - return false; - final Object this$color = this.getColor(); - final Object other$color = other.getColor(); - if (this$color == null ? other$color != null : !this$color.equals(other$color)) - return false; - final Object this$fontColor = this.getFontColor(); - final Object other$fontColor = other.getFontColor(); - if (this$fontColor == null ? other$fontColor != null : !this$fontColor.equals(other$fontColor)) - return false; - final Object this$sessions = this.getSessions(); - final Object other$sessions = other.getSessions(); - if (this$sessions == null ? other$sessions != null : !this$sessions.equals(other$sessions)) - return false; - return true; - } - - public int hashCode() { - final int PRIME = 59; - int result = 1; - result = result * PRIME + super.hashCode(); - result = result * PRIME + this.getId(); - final Object $name = this.getName(); - result = result * PRIME + ($name == null ? 43 : $name.hashCode()); - final Object $description = this.getDescription(); - result = result * PRIME + ($description == null ? 43 : $description.hashCode()); - final Object $color = this.getColor(); - result = result * PRIME + ($color == null ? 43 : $color.hashCode()); - final Object $fontColor = this.getFontColor(); - result = result * PRIME + ($fontColor == null ? 43 : $fontColor.hashCode()); - final Object $sessions = this.getSessions(); - result = result * PRIME + ($sessions == null ? 43 : $sessions.hashCode()); - return result; - } - - protected boolean canEqual(Object other) { - return other instanceof Track; - } -} \ No newline at end of file diff --git a/android/app/src/main/java/org/fossasia/openevent/data/Track.kt b/android/app/src/main/java/org/fossasia/openevent/data/Track.kt new file mode 100644 index 0000000000..6c2826b892 --- /dev/null +++ b/android/app/src/main/java/org/fossasia/openevent/data/Track.kt @@ -0,0 +1,28 @@ +package org.fossasia.openevent.data + +import com.fasterxml.jackson.databind.PropertyNamingStrategy +import com.fasterxml.jackson.databind.annotation.JsonNaming +import com.github.jasminb.jsonapi.IntegerIdHandler +import com.github.jasminb.jsonapi.annotations.Id +import com.github.jasminb.jsonapi.annotations.Relationship +import com.github.jasminb.jsonapi.annotations.Type + +import io.realm.RealmList +import io.realm.RealmObject +import io.realm.annotations.Index +import io.realm.annotations.PrimaryKey + +@Type("track") +@JsonNaming(PropertyNamingStrategy.KebabCaseStrategy::class) +open class Track( + @PrimaryKey + @Id(IntegerIdHandler::class) + var id: Int = 0, + @Index + var name: String? = null, + var description: String? = null, + var color: String? = null, + var fontColor: String? = null, + @Relationship("sessions") + var sessions: RealmList? = null +) : RealmObject() \ No newline at end of file diff --git a/android/app/src/main/java/org/fossasia/openevent/data/extras/Copyright.java b/android/app/src/main/java/org/fossasia/openevent/data/extras/Copyright.java deleted file mode 100644 index c129af3d3b..0000000000 --- a/android/app/src/main/java/org/fossasia/openevent/data/extras/Copyright.java +++ /dev/null @@ -1,140 +0,0 @@ -package org.fossasia.openevent.data.extras; - -import com.fasterxml.jackson.databind.PropertyNamingStrategy; -import com.fasterxml.jackson.databind.annotation.JsonNaming; -import com.github.jasminb.jsonapi.IntegerIdHandler; -import com.github.jasminb.jsonapi.annotations.Id; -import com.github.jasminb.jsonapi.annotations.Type; - -import io.realm.RealmObject; -import io.realm.annotations.PrimaryKey; - -@Type("event-copyright") -@JsonNaming(PropertyNamingStrategy.KebabCaseStrategy.class) -public class Copyright extends RealmObject { - - @PrimaryKey - @Id(IntegerIdHandler.class) - private int id; - private String licenceUrl; - private String holderUrl; - private String licence; - private int year; - private String logoUrl; - private String holder; - - public Copyright() { - } - - public int getId() { - return this.id; - } - - public String getLicenceUrl() { - return this.licenceUrl; - } - - public String getHolderUrl() { - return this.holderUrl; - } - - public String getLicence() { - return this.licence; - } - - public int getYear() { - return this.year; - } - - public String getLogoUrl() { - return this.logoUrl; - } - - public String getHolder() { - return this.holder; - } - - public void setId(int id) { - this.id = id; - } - - public void setLicenceUrl(String licenceUrl) { - this.licenceUrl = licenceUrl; - } - - public void setHolderUrl(String holderUrl) { - this.holderUrl = holderUrl; - } - - public void setLicence(String licence) { - this.licence = licence; - } - - public void setYear(int year) { - this.year = year; - } - - public void setLogoUrl(String logoUrl) { - this.logoUrl = logoUrl; - } - - public void setHolder(String holder) { - this.holder = holder; - } - - public String toString() { - return "Copyright(id=" + this.getId() + ", licenceUrl=" + this.getLicenceUrl() + ", holderUrl=" + this.getHolderUrl() + ", licence=" + this.getLicence() + ", year=" + this.getYear() + ", logoUrl=" + this.getLogoUrl() + ", holder=" + this.getHolder() + ")"; - } - - public boolean equals(Object o) { - if (o == this) return true; - if (!(o instanceof Copyright)) return false; - final Copyright other = (Copyright) o; - if (!other.canEqual((Object) this)) return false; - if (this.getId() != other.getId()) return false; - final Object this$licenceUrl = this.getLicenceUrl(); - final Object other$licenceUrl = other.getLicenceUrl(); - if (this$licenceUrl == null ? other$licenceUrl != null : !this$licenceUrl.equals(other$licenceUrl)) - return false; - final Object this$holderUrl = this.getHolderUrl(); - final Object other$holderUrl = other.getHolderUrl(); - if (this$holderUrl == null ? other$holderUrl != null : !this$holderUrl.equals(other$holderUrl)) - return false; - final Object this$licence = this.getLicence(); - final Object other$licence = other.getLicence(); - if (this$licence == null ? other$licence != null : !this$licence.equals(other$licence)) - return false; - if (this.getYear() != other.getYear()) return false; - final Object this$logoUrl = this.getLogoUrl(); - final Object other$logoUrl = other.getLogoUrl(); - if (this$logoUrl == null ? other$logoUrl != null : !this$logoUrl.equals(other$logoUrl)) - return false; - final Object this$holder = this.getHolder(); - final Object other$holder = other.getHolder(); - if (this$holder == null ? other$holder != null : !this$holder.equals(other$holder)) - return false; - return true; - } - - public int hashCode() { - final int PRIME = 59; - int result = 1; - result = result * PRIME + this.getId(); - final Object $licenceUrl = this.getLicenceUrl(); - result = result * PRIME + ($licenceUrl == null ? 43 : $licenceUrl.hashCode()); - final Object $holderUrl = this.getHolderUrl(); - result = result * PRIME + ($holderUrl == null ? 43 : $holderUrl.hashCode()); - final Object $licence = this.getLicence(); - result = result * PRIME + ($licence == null ? 43 : $licence.hashCode()); - result = result * PRIME + this.getYear(); - final Object $logoUrl = this.getLogoUrl(); - result = result * PRIME + ($logoUrl == null ? 43 : $logoUrl.hashCode()); - final Object $holder = this.getHolder(); - result = result * PRIME + ($holder == null ? 43 : $holder.hashCode()); - return result; - } - - protected boolean canEqual(Object other) { - return other instanceof Copyright; - } -} diff --git a/android/app/src/main/java/org/fossasia/openevent/data/extras/Copyright.kt b/android/app/src/main/java/org/fossasia/openevent/data/extras/Copyright.kt new file mode 100644 index 0000000000..15995fa8d3 --- /dev/null +++ b/android/app/src/main/java/org/fossasia/openevent/data/extras/Copyright.kt @@ -0,0 +1,25 @@ +package org.fossasia.openevent.data.extras + +import com.fasterxml.jackson.databind.PropertyNamingStrategy +import com.fasterxml.jackson.databind.annotation.JsonNaming +import com.github.jasminb.jsonapi.IntegerIdHandler +import com.github.jasminb.jsonapi.annotations.Id +import com.github.jasminb.jsonapi.annotations.Type + +import io.realm.RealmObject +import io.realm.annotations.PrimaryKey + +@Type("event-copyright") +@JsonNaming(PropertyNamingStrategy.KebabCaseStrategy::class) +open class Copyright( + @PrimaryKey + @Id(IntegerIdHandler::class) + var id: Int = 0, + var licenceUrl: String? = null, + var holderUrl: String? = null, + var licence: String? = null, + var year: Int = 0, + var logoUrl: String? = null, + var holder: String? = null + +) : RealmObject() diff --git a/android/app/src/main/java/org/fossasia/openevent/data/extras/EventDates.java b/android/app/src/main/java/org/fossasia/openevent/data/extras/EventDates.java deleted file mode 100644 index 41acfb00a9..0000000000 --- a/android/app/src/main/java/org/fossasia/openevent/data/extras/EventDates.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.fossasia.openevent.data.extras; - -import io.realm.RealmObject; -import io.realm.annotations.PrimaryKey; - -public class EventDates extends RealmObject { - - @PrimaryKey - private String date; - - public EventDates(String date) { - this.date = date; - } - - public EventDates() { - } - - public String getDate() { - return this.date; - } - - public void setDate(String date) { - this.date = date; - } - - public String toString() { - return "EventDates(date=" + this.getDate() + ")"; - } - - public boolean equals(Object o) { - if (o == this) return true; - if (!(o instanceof EventDates)) return false; - final EventDates other = (EventDates) o; - if (!other.canEqual((Object) this)) return false; - final Object this$date = this.getDate(); - final Object other$date = other.getDate(); - if (this$date == null ? other$date != null : !this$date.equals(other$date)) return false; - return true; - } - - public int hashCode() { - final int PRIME = 59; - int result = 1; - final Object $date = this.getDate(); - result = result * PRIME + ($date == null ? 43 : $date.hashCode()); - return result; - } - - protected boolean canEqual(Object other) { - return other instanceof EventDates; - } -} diff --git a/android/app/src/main/java/org/fossasia/openevent/data/extras/EventDates.kt b/android/app/src/main/java/org/fossasia/openevent/data/extras/EventDates.kt new file mode 100644 index 0000000000..0f98e70c8c --- /dev/null +++ b/android/app/src/main/java/org/fossasia/openevent/data/extras/EventDates.kt @@ -0,0 +1,9 @@ +package org.fossasia.openevent.data.extras + +import io.realm.RealmObject +import io.realm.annotations.PrimaryKey + +open class EventDates( + @PrimaryKey + var date: String? = null +): RealmObject() diff --git a/android/app/src/main/java/org/fossasia/openevent/data/extras/SocialLink.java b/android/app/src/main/java/org/fossasia/openevent/data/extras/SocialLink.java deleted file mode 100644 index 6db024b10c..0000000000 --- a/android/app/src/main/java/org/fossasia/openevent/data/extras/SocialLink.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.fossasia.openevent.data.extras; - -import com.fasterxml.jackson.databind.PropertyNamingStrategy; -import com.fasterxml.jackson.databind.annotation.JsonNaming; -import com.github.jasminb.jsonapi.IntegerIdHandler; -import com.github.jasminb.jsonapi.annotations.Id; -import com.github.jasminb.jsonapi.annotations.Type; - -import io.realm.RealmObject; -import io.realm.annotations.PrimaryKey; - -@Type("social-link") -@JsonNaming(PropertyNamingStrategy.KebabCaseStrategy.class) -public class SocialLink extends RealmObject { - - @PrimaryKey - @Id(IntegerIdHandler.class) - private int id; - private String name; - private String link; - - public SocialLink(int id, String name, String link) { - this.id = id; - this.name = name; - this.link = link; - } - - public SocialLink() { - } - - public int getId() { - return this.id; - } - - public String getName() { - return this.name; - } - - public String getLink() { - return this.link; - } - - public void setId(int id) { - this.id = id; - } - - public void setName(String name) { - this.name = name; - } - - public void setLink(String link) { - this.link = link; - } - - public String toString() { - return "SocialLink(id=" + this.getId() + ", name=" + this.getName() + ", link=" + this.getLink() + ")"; - } - - public boolean equals(Object o) { - if (o == this) return true; - if (!(o instanceof SocialLink)) return false; - final SocialLink other = (SocialLink) o; - if (!other.canEqual((Object) this)) return false; - if (this.getId() != other.getId()) return false; - final Object this$name = this.getName(); - final Object other$name = other.getName(); - if (this$name == null ? other$name != null : !this$name.equals(other$name)) return false; - final Object this$link = this.getLink(); - final Object other$link = other.getLink(); - if (this$link == null ? other$link != null : !this$link.equals(other$link)) return false; - return true; - } - - public int hashCode() { - final int PRIME = 59; - int result = 1; - result = result * PRIME + this.getId(); - final Object $name = this.getName(); - result = result * PRIME + ($name == null ? 43 : $name.hashCode()); - final Object $link = this.getLink(); - result = result * PRIME + ($link == null ? 43 : $link.hashCode()); - return result; - } - - protected boolean canEqual(Object other) { - return other instanceof SocialLink; - } -} diff --git a/android/app/src/main/java/org/fossasia/openevent/data/extras/SocialLink.kt b/android/app/src/main/java/org/fossasia/openevent/data/extras/SocialLink.kt new file mode 100644 index 0000000000..a3111861e7 --- /dev/null +++ b/android/app/src/main/java/org/fossasia/openevent/data/extras/SocialLink.kt @@ -0,0 +1,20 @@ +package org.fossasia.openevent.data.extras + +import com.fasterxml.jackson.databind.PropertyNamingStrategy +import com.fasterxml.jackson.databind.annotation.JsonNaming +import com.github.jasminb.jsonapi.IntegerIdHandler +import com.github.jasminb.jsonapi.annotations.Id +import com.github.jasminb.jsonapi.annotations.Type + +import io.realm.RealmObject +import io.realm.annotations.PrimaryKey + +@Type("social-link") +@JsonNaming(PropertyNamingStrategy.KebabCaseStrategy::class) +open class SocialLink( + @PrimaryKey + @Id(IntegerIdHandler::class) + var id: Int = 0, + var name: String? = null, + var link: String? = null +) : RealmObject() diff --git a/android/app/src/main/java/org/fossasia/openevent/data/extras/SpeakersCall.java b/android/app/src/main/java/org/fossasia/openevent/data/extras/SpeakersCall.java deleted file mode 100644 index fac51b3559..0000000000 --- a/android/app/src/main/java/org/fossasia/openevent/data/extras/SpeakersCall.java +++ /dev/null @@ -1,128 +0,0 @@ -package org.fossasia.openevent.data.extras; - -import com.fasterxml.jackson.databind.PropertyNamingStrategy; -import com.fasterxml.jackson.databind.annotation.JsonNaming; -import com.github.jasminb.jsonapi.IntegerIdHandler; -import com.github.jasminb.jsonapi.annotations.Id; -import com.github.jasminb.jsonapi.annotations.Type; - -import io.realm.RealmObject; -import io.realm.annotations.PrimaryKey; - -@Type("speakers-call") -@JsonNaming(PropertyNamingStrategy.KebabCaseStrategy.class) -public class SpeakersCall extends RealmObject { - - @PrimaryKey - @Id(IntegerIdHandler.class) - private int id; - private String announcement; - private String privacy; - private String startsAt; - private String endsAt; - private String hash; - - public SpeakersCall() { - } - - public int getId() { - return this.id; - } - - public String getAnnouncement() { - return this.announcement; - } - - public String getPrivacy() { - return this.privacy; - } - - public String getStartsAt() { - return this.startsAt; - } - - public String getEndsAt() { - return this.endsAt; - } - - public String getHash() { - return this.hash; - } - - public void setId(int id) { - this.id = id; - } - - public void setAnnouncement(String announcement) { - this.announcement = announcement; - } - - public void setPrivacy(String privacy) { - this.privacy = privacy; - } - - public void setStartsAt(String startsAt) { - this.startsAt = startsAt; - } - - public void setEndsAt(String endsAt) { - this.endsAt = endsAt; - } - - public void setHash(String hash) { - this.hash = hash; - } - - public String toString() { - return "SpeakersCall(id=" + this.getId() + ", announcement=" + this.getAnnouncement() + ", privacy=" + this.getPrivacy() + ", startsAt=" + this.getStartsAt() + ", endsAt=" + this.getEndsAt() + ", hash=" + this.getHash() + ")"; - } - - public boolean equals(Object o) { - if (o == this) return true; - if (!(o instanceof SpeakersCall)) return false; - final SpeakersCall other = (SpeakersCall) o; - if (!other.canEqual((Object) this)) return false; - if (this.getId() != other.getId()) return false; - final Object this$announcement = this.getAnnouncement(); - final Object other$announcement = other.getAnnouncement(); - if (this$announcement == null ? other$announcement != null : !this$announcement.equals(other$announcement)) - return false; - final Object this$privacy = this.getPrivacy(); - final Object other$privacy = other.getPrivacy(); - if (this$privacy == null ? other$privacy != null : !this$privacy.equals(other$privacy)) - return false; - final Object this$startsAt = this.getStartsAt(); - final Object other$startsAt = other.getStartsAt(); - if (this$startsAt == null ? other$startsAt != null : !this$startsAt.equals(other$startsAt)) - return false; - final Object this$endsAt = this.getEndsAt(); - final Object other$endsAt = other.getEndsAt(); - if (this$endsAt == null ? other$endsAt != null : !this$endsAt.equals(other$endsAt)) - return false; - final Object this$hash = this.getHash(); - final Object other$hash = other.getHash(); - if (this$hash == null ? other$hash != null : !this$hash.equals(other$hash)) return false; - return true; - } - - public int hashCode() { - final int PRIME = 59; - int result = 1; - result = result * PRIME + this.getId(); - final Object $announcement = this.getAnnouncement(); - result = result * PRIME + ($announcement == null ? 43 : $announcement.hashCode()); - final Object $privacy = this.getPrivacy(); - result = result * PRIME + ($privacy == null ? 43 : $privacy.hashCode()); - final Object $startsAt = this.getStartsAt(); - result = result * PRIME + ($startsAt == null ? 43 : $startsAt.hashCode()); - final Object $endsAt = this.getEndsAt(); - result = result * PRIME + ($endsAt == null ? 43 : $endsAt.hashCode()); - final Object $hash = this.getHash(); - result = result * PRIME + ($hash == null ? 43 : $hash.hashCode()); - return result; - } - - protected boolean canEqual(Object other) { - return other instanceof SpeakersCall; - } -} diff --git a/android/app/src/main/java/org/fossasia/openevent/data/extras/SpeakersCall.kt b/android/app/src/main/java/org/fossasia/openevent/data/extras/SpeakersCall.kt new file mode 100644 index 0000000000..0c1cfe5d4f --- /dev/null +++ b/android/app/src/main/java/org/fossasia/openevent/data/extras/SpeakersCall.kt @@ -0,0 +1,23 @@ +package org.fossasia.openevent.data.extras + +import com.fasterxml.jackson.databind.PropertyNamingStrategy +import com.fasterxml.jackson.databind.annotation.JsonNaming +import com.github.jasminb.jsonapi.IntegerIdHandler +import com.github.jasminb.jsonapi.annotations.Id +import com.github.jasminb.jsonapi.annotations.Type + +import io.realm.RealmObject +import io.realm.annotations.PrimaryKey + +@Type("speakers-call") +@JsonNaming(PropertyNamingStrategy.KebabCaseStrategy::class) +open class SpeakersCall( + @PrimaryKey + @Id(IntegerIdHandler::class) + var id: Int = 0, + var announcement: String? = null, + var privacy: String? = null, + var startsAt: String? = null, + var endsAt: String? = null, + var hash: String? = null +) : RealmObject() diff --git a/android/app/src/main/java/org/fossasia/openevent/data/repository/RealmDataRepository.java b/android/app/src/main/java/org/fossasia/openevent/data/repository/RealmDataRepository.java index 93ec69394a..421300662e 100644 --- a/android/app/src/main/java/org/fossasia/openevent/data/repository/RealmDataRepository.java +++ b/android/app/src/main/java/org/fossasia/openevent/data/repository/RealmDataRepository.java @@ -264,8 +264,8 @@ private void saveSessionsInRealm(final List sessions) { for(Session session : sessions) { // If session was previously bookmarked, set this one too Session storedSession = transaction.where(Session.class).equalTo("id", session.getId()).findFirst(); - if(storedSession != null && storedSession.getIsBookmarked()) - session.setIsBookmarked(true); + if(storedSession != null && storedSession.isBookmarked()) + session.setBookmarked(true); List speakers = session.getSpeakers(); @@ -341,7 +341,7 @@ public Completable setBookmark(final int sessionId, final boolean bookmark) { realm1.where(Session.class) .equalTo("id", sessionId) .findFirst() - .setIsBookmarked(bookmark); + .setBookmarked(bookmark); StrategyRegistry.getInstance() .getEventBusStrategy() @@ -381,7 +381,7 @@ public RealmResults getSessionsFiltered(int trackId, String query) { } public RealmResults getSessionsByLocation(String location) { - return realm.where(Session.class).equalTo("microlocation.name", location).findAllSortedAsync(Session.START_TIME); + return realm.where(Session.class).equalTo("microlocation.name", location).findAllSortedAsync(Session.Companion.getSTART_TIME()); } public RealmResults getSessionsByDate(String date) { diff --git a/android/build.gradle b/android/build.gradle index da09b8d9bb..08e254508f 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,6 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { + ext.kotlin_version = '1.2.30' repositories { jcenter() google() @@ -8,6 +9,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:3.0.1' classpath 'io.realm:realm-gradle-plugin:3.7.2' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }