From 4d3a1233d9ae5ac417e92390a1ef32c7231a7ebc Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Thu, 7 Dec 2023 17:52:12 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20Reject=E3=81=AEJSON=E3=83=87=E3=82=B7?= =?UTF-8?q?=E3=83=AA=E3=82=A2=E3=83=A9=E3=82=A4=E3=82=BA=E7=94=A8=E3=81=AE?= =?UTF-8?q?POJO=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../activitypub/domain/model/Reject.kt | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Reject.kt diff --git a/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Reject.kt b/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Reject.kt new file mode 100644 index 00000000..fd0e980e --- /dev/null +++ b/src/main/kotlin/dev/usbharu/hideout/activitypub/domain/model/Reject.kt @@ -0,0 +1,45 @@ +package dev.usbharu.hideout.activitypub.domain.model + +import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.databind.annotation.JsonDeserialize +import dev.usbharu.hideout.activitypub.domain.model.objects.Object +import dev.usbharu.hideout.activitypub.domain.model.objects.ObjectDeserializer + +open class Reject( + override val actor: String, + override val id: String, + @JsonDeserialize(using = ObjectDeserializer::class) @JsonProperty("object") val apObject: Object +) : Object(listOf("Reject")), HasId, HasActor { + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (javaClass != other?.javaClass) return false + if (!super.equals(other)) return false + + other as Reject + + if (actor != other.actor) return false + if (id != other.id) return false + if (apObject != other.apObject) return false + + return true + } + + override fun hashCode(): Int { + var result = super.hashCode() + result = 31 * result + actor.hashCode() + result = 31 * result + id.hashCode() + result = 31 * result + apObject.hashCode() + return result + } + + override fun toString(): String { + return "Reject(" + + "actor='$actor', " + + "id='$id', " + + "apObject=$apObject" + + ")" + + " ${super.toString()}" + } + + +}