File tree Expand file tree Collapse file tree 2 files changed +51
-76
lines changed
app/src/main/java/io/intrepid/contest/models Expand file tree Collapse file tree 2 files changed +51
-76
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ package io.intrepid.contest.models
2
+
3
+ import android.os.Parcel
4
+ import android.os.Parcelable
5
+ import java.util.*
6
+
7
+ class Category : Parcelable {
8
+ val id: UUID ? = null
9
+ var name: String? = null
10
+ var description: String? = null
11
+
12
+ constructor (name: String , description: String ) {
13
+ this .name = name
14
+ this .description = description
15
+ }
16
+
17
+ protected constructor (`in `: Parcel ) {
18
+ name = `in `.readString()
19
+ description = `in `.readString()
20
+ }
21
+
22
+ override fun writeToParcel (dest : Parcel , flags : Int ) {
23
+ dest.writeString(name)
24
+ dest.writeString(description)
25
+ }
26
+
27
+ override fun describeContents (): Int {
28
+ return 0
29
+ }
30
+
31
+ override fun equals (obj : Any? ): Boolean {
32
+ try {
33
+ val otherCategory = obj as Category ?
34
+ return this .name == otherCategory!! .name && this .description == otherCategory.description
35
+ } catch (exception: ClassCastException ) {
36
+ return false
37
+ }
38
+ }
39
+
40
+ companion object {
41
+ val CREATOR : Parcelable .Creator <Category > = object : Parcelable .Creator <Category > {
42
+ override fun createFromParcel (`in `: Parcel ): Category {
43
+ return Category (`in `)
44
+ }
45
+
46
+ override fun newArray (size : Int ): Array <Category ?> {
47
+ return arrayOfNulls(size)
48
+ }
49
+ }
50
+ }
51
+ }
You can’t perform that action at this time.
0 commit comments