-
Notifications
You must be signed in to change notification settings - Fork 0
/
Item.kt
127 lines (115 loc) · 4.02 KB
/
Item.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
package dev.patbeagan.protocolrss.core
import com.fasterxml.jackson.annotation.JsonPropertyOrder
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty
import java.net.URL
@JsonPropertyOrder(
"title",
"link",
"description",
"pubDate",
"guid",
)
/**
* A channel may contain any number of <item>s.
* An item may represent a "story" -- much like a story in a newspaper or magazine; if so its description is a synopsis of the story, and the link points to the full story.
* An item may also be complete in itself, if so, the description contains the text (entity-encoded HTML is allowed; see examples), and the link and title may be omitted.
* All elements of an item are optional, however at least one of title or description must be present.
*
* **title OR description is required**
*/
data class Item(
/**
* The title of the item.
*/
@JvmField
@field:JacksonXmlProperty
var title: String? = null,
/**
* The item synopsis.
*/
@JvmField
@field:JacksonXmlProperty
var description: String? = null,
/**
* Email address of the author of the item.
*
* `<author>` is an optional sub-element of `<item>`.
*
* It's the email address of the author of the item.
* For newspapers and magazines syndicating via RSS,
* the author is the person who wrote the article that the `<item>` describes.
* For collaborative weblogs, the author of the item might be different from the managing editor or webmaster.
* For a weblog authored by a single individual it would make sense to omit the `<author>` element.
*
* ```
* <author>lawyer@boyer.net (Lawyer Boyer)</author>
* ```
* [More](https://www.rssboard.org/rss-specification#ltauthorgtSubelementOfLtitemgt).
*/
@JvmField
@field:JacksonXmlProperty
var author: String? = null,
/**
* Includes the item in one or more categories.
* [More](https://www.rssboard.org/rss-specification#ltcategorygtSubelementOfLtitemgt).
*/
@JvmField
@field:JacksonXmlProperty(localName = "category")
var categories: List<Category>? = null,
/**
* URL of a page for comments relating to the item.
*
* `<comments>` is an optional sub-element of `<item>`.
*
* If present, it is the url of the comments page for the item.
*```
* <comments>http://ekzemplo.com/entry/4403/comments</comments>
*```
* More about comments [here](https://www.rssboard.org/rss-weblog-comments-use-case).
* And [here](https://www.rssboard.org/rss-specification#ltcommentsgtSubelementOfLtitemgt).
*/
@JvmField
@field:JacksonXmlProperty
var comments: String? = null,
/**
* Describes a media object that is attached to the item.
* [More](https://www.rssboard.org/rss-specification#ltenclosuregtSubelementOfLtitemgt).
*/
@JvmField
@field:JacksonXmlProperty
var enclosure: Enclosure? = null,
/**
* A string that uniquely identifies the item.
* [More](https://www.rssboard.org/rss-specification#ltguidgtSubelementOfLtitemgt).
*/
@JvmField
@field:JacksonXmlProperty
var guid: Guid? = null,
/**
* The URL of the item.
*/
@JvmField
@field:JacksonXmlProperty
var link: URL? = null,
/**
* Indicates when the item was published.
*
* `<pubDate>` is an optional sub-element of `<item>`.
*
* Its value is a date, indicating when the item was published. If it's a date in the future, aggregators may choose to not display the item until that date.
* ```
* <pubDate>Sun, 19 May 2002 15:21:36 GMT</pubDate>
* ```
* [More](https://www.rssboard.org/rss-specification#ltpubdategtSubelementOfLtitemgt).
*/
@JvmField
@field:JacksonXmlProperty
var pubDate: String? = null,
/**
* The RSS channel that the item came from.
* [More](https://www.rssboard.org/rss-specification#ltsourcegtSubelementOfLtitemgt).
*/
@JvmField
@field:JacksonXmlProperty
var source: Source? = null,
)