Skip to content

Commit 8f37a68

Browse files
Gabi Scardine SilvaGabi Scardine Silva
Gabi Scardine Silva
authored and
Gabi Scardine Silva
committed
Convert Score and eliminate old Contest setters
1 parent 5d7c285 commit 8f37a68

File tree

3 files changed

+28
-55
lines changed

3 files changed

+28
-55
lines changed

app/src/main/java/io/intrepid/contest/models/Contest.kt

-10
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,6 @@ open class Contest {
6161
description = `in`.readString()
6262
}
6363

64-
fun setTitle(title: String): Builder {
65-
this.title = title
66-
return this
67-
}
68-
69-
fun setDescription(description: String): Builder {
70-
this.description = description
71-
return this
72-
}
73-
7464
fun build(): Contest {
7565
if (creationDate == null) {
7666
creationDate = Date()

app/src/main/java/io/intrepid/contest/models/Score.java

-45
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package io.intrepid.contest.models
2+
3+
import com.google.gson.annotations.SerializedName
4+
5+
import java.util.UUID
6+
7+
class Score(category: Category, score: Int) {
8+
var scoreValue: Int = 0
9+
internal set
10+
@SerializedName("scoring_category_id")
11+
private val categoryId: UUID?
12+
@Transient val categoryName: String?
13+
@Transient val categoryDescription: String?
14+
15+
init {
16+
this.categoryId = category.id
17+
this.categoryName = category.name
18+
this.categoryDescription = category.description
19+
this.scoreValue = score
20+
}
21+
22+
override fun equals(other: Any?): Boolean {
23+
if (other !is Score) {
24+
return false
25+
}
26+
return scoreValue == other.scoreValue
27+
}
28+
}

0 commit comments

Comments
 (0)