Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert models to Kotlin #142

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package io.intrepid.contest.models

open class ActiveContestListResponse(val contests: List<Contest>)
10 changes: 0 additions & 10 deletions app/src/main/java/io/intrepid/contest/models/Adjudication.java

This file was deleted.

8 changes: 8 additions & 0 deletions app/src/main/java/io/intrepid/contest/models/Adjudication.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package io.intrepid.contest.models

import com.google.gson.annotations.SerializedName

class Adjudication {
@SerializedName("entries")
var entryBallots: List<EntryBallot>? = null
}
76 changes: 0 additions & 76 deletions app/src/main/java/io/intrepid/contest/models/Category.java

This file was deleted.

51 changes: 51 additions & 0 deletions app/src/main/java/io/intrepid/contest/models/Category.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package io.intrepid.contest.models

import android.os.Parcel
import android.os.Parcelable
import java.util.*

open class Category : Parcelable {
val id: UUID? = null
var name: String? = null
var description: String? = null

constructor(name: String, description: String) {
this.name = name
this.description = description
}

protected constructor(`in`: Parcel) {
name = `in`.readString()
description = `in`.readString()
}

override fun writeToParcel(dest: Parcel, flags: Int) {
dest.writeString(name)
dest.writeString(description)
}

override fun describeContents(): Int {
return 0
}

override fun equals(obj: Any?): Boolean {
try {
val otherCategory = obj as Category?
return this.name == otherCategory!!.name && this.description == otherCategory.description
} catch (exception: ClassCastException) {
return false
}
}

companion object {
val CREATOR: Parcelable.Creator<Category> = object : Parcelable.Creator<Category> {
override fun createFromParcel(`in`: Parcel): Category {
return Category(`in`)
}

override fun newArray(size: Int): Array<Category?> {
return arrayOfNulls(size)
}
}
}
}
67 changes: 0 additions & 67 deletions app/src/main/java/io/intrepid/contest/models/Contact.java

This file was deleted.

11 changes: 11 additions & 0 deletions app/src/main/java/io/intrepid/contest/models/Contact.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package io.intrepid.contest.models

class Contact {
var id: Long = 0
var name: String? = null
var phone: String? = null
var email: String? = null
var photo: ByteArray? = null
var isSelected = false
var isEnabled = true
}
Loading