diff options
| author | James Barnett <noreply@jamesbarnett.xyz> | 2020-04-10 13:34:23 +0100 |
|---|---|---|
| committer | James Barnett <noreply@jamesbarnett.xyz> | 2020-04-10 13:34:23 +0100 |
| commit | 78400d587ea5367d3424333913ff4f94ca3f1908 (patch) | |
| tree | 2cf5f5ff8069740b0b7dd00853a4ea8c13d6e05c /src/main/kotlin/io/jamesbarnett/redditlite/model/PostDetail.kt | |
| parent | d5a608143ad2250d8b35b9e4a488d39faaf5a021 (diff) | |
| download | reddit-lite-78400d587ea5367d3424333913ff4f94ca3f1908.tar.xz reddit-lite-78400d587ea5367d3424333913ff4f94ca3f1908.zip | |
Reimplement in Kotlin
Diffstat (limited to 'src/main/kotlin/io/jamesbarnett/redditlite/model/PostDetail.kt')
| -rw-r--r-- | src/main/kotlin/io/jamesbarnett/redditlite/model/PostDetail.kt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/kotlin/io/jamesbarnett/redditlite/model/PostDetail.kt b/src/main/kotlin/io/jamesbarnett/redditlite/model/PostDetail.kt new file mode 100644 index 0000000..c5b58f0 --- /dev/null +++ b/src/main/kotlin/io/jamesbarnett/redditlite/model/PostDetail.kt @@ -0,0 +1,9 @@ +package io.jamesbarnett.redditlite.model + +import org.apache.commons.text.StringEscapeUtils + +data class PostDetail(val post: Post, val comments: List<Comment>) { + val isSelfPost get() = post.isSelfPost + val selftextHtmlUnescaped: String? get() = StringEscapeUtils.unescapeHtml4(post.selftextHtml) + val commentCount get() = post.commentCount +} |