mirror of https://github.com/usbharu/Hideout.git
fix: #191 ImageのmediaTypeをnullableに
This commit is contained in:
parent
b785d241f8
commit
73e04bdd8a
|
@ -4,12 +4,11 @@ import dev.usbharu.hideout.activitypub.domain.model.objects.Object
|
|||
|
||||
open class Image(
|
||||
type: List<String> = emptyList(),
|
||||
val mediaType: String,
|
||||
val mediaType: String? = null,
|
||||
val url: String
|
||||
) : Object(
|
||||
add(type, "Image")
|
||||
) {
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (this === other) return true
|
||||
if (javaClass != other?.javaClass) return false
|
||||
|
@ -25,10 +24,18 @@ open class Image(
|
|||
|
||||
override fun hashCode(): Int {
|
||||
var result = super.hashCode()
|
||||
result = 31 * result + mediaType.hashCode()
|
||||
result = 31 * result + (mediaType?.hashCode() ?: 0)
|
||||
result = 31 * result + url.hashCode()
|
||||
return result
|
||||
}
|
||||
|
||||
override fun toString(): String = "Image(mediaType=$mediaType, url=$url) ${super.toString()}"
|
||||
override fun toString(): String {
|
||||
return "Image(" +
|
||||
"mediaType=$mediaType, " +
|
||||
"url='$url'" +
|
||||
")" +
|
||||
" ${super.toString()}"
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue