From 7e93db6c7e3399d0e9d3770ce1b7eb734edbf268 Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Fri, 8 Dec 2023 12:29:26 +0900 Subject: [PATCH] fix: #201 --- .../activitypub/domain/model/Create.kt | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Create.kt b/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Create.kt index d5b269dd..3a27e800 100644 --- a/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Create.kt +++ b/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Create.kt @@ -7,7 +7,7 @@ import dev.usbharu.hideout.activitypub.domain.model.objects.ObjectDeserializer open class Create( type: List = emptyList(), - override val name: String, + val name: String? = null, @JsonDeserialize(using = ObjectDeserializer::class) @JsonProperty("object") val apObject: Object, @@ -19,7 +19,6 @@ open class Create( type = add(type, "Create") ), HasId, - HasName, HasActor { override fun equals(other: Any?): Boolean { @@ -41,7 +40,7 @@ open class Create( override fun hashCode(): Int { var result = super.hashCode() - result = 31 * result + name.hashCode() + result = 31 * result + (name?.hashCode() ?: 0) result = 31 * result + apObject.hashCode() result = 31 * result + actor.hashCode() result = 31 * result + id.hashCode() @@ -52,13 +51,13 @@ open class Create( override fun toString(): String { return "Create(" + - "name='$name', " + - "apObject=$apObject, " + - "actor='$actor', " + - "id='$id', " + - "to=$to, " + - "cc=$cc" + - ")" + - " ${super.toString()}" + "name=$name, " + + "apObject=$apObject, " + + "actor='$actor', " + + "id='$id', " + + "to=$to, " + + "cc=$cc" + + ")" + + " ${super.toString()}" } }