fix: toStringを修正

This commit is contained in:
usbharu 2023-12-14 14:37:59 +09:00
parent 48bbf6a53b
commit ec848630ca
9 changed files with 104 additions and 27 deletions

View File

@ -50,6 +50,15 @@ open class Delete : Object, HasId, HasActor {
return result
}
override fun toString(): String =
"Delete(`object`=$apObject, published=$published, actor='$actor', id='$id') ${super.toString()}"
override fun toString(): String {
return "Delete(" +
"apObject=$apObject, " +
"published='$published', " +
"actor='$actor', " +
"id='$id'" +
")" +
" ${super.toString()}"
}
}

View File

@ -30,5 +30,15 @@ open class Emoji(
return result
}
override fun toString(): String = "Emoji(updated=$updated, icon=$icon) ${super.toString()}"
override fun toString(): String {
return "Emoji(" +
"name='$name', " +
"id='$id', " +
"updated='$updated', " +
"icon=$icon" +
")" +
" ${super.toString()}"
}
}

View File

@ -32,5 +32,13 @@ open class Follow(
return result
}
override fun toString(): String = "Follow(`object`=$apObject, actor='$actor') ${super.toString()}"
override fun toString(): String {
return "Follow(" +
"apObject='$apObject', " +
"actor='$actor'" +
")" +
" ${super.toString()}"
}
}

View File

@ -38,6 +38,15 @@ open class Undo(
return result
}
override fun toString(): String =
"Undo(`object`=$apObject, published=$published, actor='$actor', id='$id') ${super.toString()}"
override fun toString(): String {
return "Undo(" +
"actor='$actor', " +
"id='$id', " +
"apObject=$apObject, " +
"published='$published'" +
")" +
" ${super.toString()}"
}
}

View File

@ -181,25 +181,31 @@ data class Actor private constructor(
fun decrementPostsCount(): Actor = this.copy(postsCount = this.postsCount - 1)
fun withLastPostAt(lastPostDate: Instant): Actor = this.copy(lastPostDate = lastPostDate)
override fun toString(): String {
return "Actor(" +
"id=$id, " +
"name='$name', " +
"domain='$domain', " +
"screenName='$screenName', " +
"description='$description', " +
"inbox='$inbox', " +
"outbox='$outbox', " +
"url='$url', " +
"publicKey='$publicKey', " +
"privateKey=$privateKey, " +
"createdAt=$createdAt, " +
"keyId='$keyId', " +
"followers=$followers, " +
"following=$following, " +
"instance=$instance, " +
"locked=$locked" +
")"
"id=$id, " +
"name='$name', " +
"domain='$domain', " +
"screenName='$screenName', " +
"description='$description', " +
"inbox='$inbox', " +
"outbox='$outbox', " +
"url='$url', " +
"publicKey='$publicKey', " +
"privateKey=$privateKey, " +
"createdAt=$createdAt, " +
"keyId='$keyId', " +
"followers=$followers, " +
"following=$following, " +
"instance=$instance, " +
"locked=$locked, " +
"followersCount=$followersCount, " +
"followingCount=$followingCount, " +
"postsCount=$postsCount, " +
"lastPostDate=$lastPostDate" +
")"
}
}

View File

@ -39,8 +39,18 @@ class HttpSignatureUser(
return result
}
override fun toString(): String {
return "HttpSignatureUser(" +
"domain='$domain', " +
"id=$id" +
")" +
" ${super.toString()}"
}
companion object {
@Serial
private const val serialVersionUID: Long = -3330552099960982997L
}
}

View File

@ -30,6 +30,15 @@ class UserDetailsImpl(
@Serial
private const val serialVersionUID: Long = -899168205656607781L
}
override fun toString(): String {
return "UserDetailsImpl(" +
"id=$id" +
")" +
" ${super.toString()}"
}
}
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY)

View File

@ -65,11 +65,20 @@ class StatusesRequest {
}
override fun toString(): String {
return "StatusesRequest(status=$status, mediaIds=$media_ids, poll=$poll, inReplyToId=$in_reply_to_id, " +
"sensitive=$sensitive, spoilerText=$spoiler_text, visibility=$visibility, language=$language," +
" scheduledAt=$scheduled_at)"
return "StatusesRequest(" +
"status=$status, " +
"media_ids=$media_ids, " +
"poll=$poll, " +
"in_reply_to_id=$in_reply_to_id, " +
"sensitive=$sensitive, " +
"spoiler_text=$spoiler_text, " +
"visibility=$visibility, " +
"language=$language, " +
"scheduled_at=$scheduled_at" +
")"
}
@Suppress("EnumNaming", "EnumEntryNameCase")
enum class Visibility {
`public`,

View File

@ -5,6 +5,13 @@ import java.io.Serial
class LruCache<K, V>(private val maxSize: Int) : LinkedHashMap<K, V>(15, 0.75f, true) {
override fun removeEldestEntry(eldest: MutableMap.MutableEntry<K, V>?): Boolean = size > maxSize
override fun toString(): String {
return "LruCache(" +
"maxSize=$maxSize" +
")" +
" ${super.toString()}"
}
companion object {
@Serial