Coverage Summary for Class: ForumBoard (com.galarzaa.tibiakt.core.section.forum.board.model)
| Class |
Method, %
|
Branch, %
|
Line, %
|
Instruction, %
|
| ForumBoard |
50%
(2/4)
|
0%
(0/2)
|
85.7%
(12/14)
|
77.8%
(182/234)
|
| ForumBoard$Companion |
0%
(0/1)
|
|
0%
(0/1)
|
0%
(0/2)
|
| Total |
40%
(2/5)
|
0%
(0/2)
|
80%
(12/15)
|
77.1%
(182/236)
|
/*
* Copyright © 2025 Allan Galarza
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.galarzaa.tibiakt.core.section.forum.board.model
import com.galarzaa.tibiakt.core.pagination.PaginatedWithUrl
import com.galarzaa.tibiakt.core.section.forum.shared.model.BaseForumBoard
import com.galarzaa.tibiakt.core.section.forum.urls.forumBoardUrl
import kotlinx.serialization.Serializable
/**
* The default thread age used in forums.
*/
public const val DEFAULT_THREAD_AGE: Int = 30
/**
* A board in the Tibia forums.
*
* @property name The name of the board.
* @property sectionId The internal ID of the section the board is in.
* @property sectionName The name of the section the board is in.
* @property threadAge The age in days of the displayed posts.
* @property announcements The announcements in the board.
*/
@Serializable
public data class ForumBoard(
val name: String,
override val boardId: Int,
val sectionId: Int,
val sectionName: String,
val threadAge: Int,
val announcements: List<AnnouncementEntry>,
override val currentPage: Int,
override val totalPages: Int,
override val resultsCount: Int,
override val entries: List<ThreadEntry>,
) : PaginatedWithUrl<ThreadEntry>, BaseForumBoard {
override val url: String get() = forumBoardUrl(boardId, currentPage, threadAge)
override fun getPageUrl(page: Int): String = forumBoardUrl(boardId, page, threadAge)
}