fix: #191 ImageのmediaTypeをnullableに

This commit is contained in:
usbharu 2023-12-06 18:19:33 +09:00
parent b785d241f8
commit 73e04bdd8a
1 changed files with 11 additions and 4 deletions

View File

@ -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()}"
}
}