Cleaned up constructors.
This commit is contained in:
parent
4e1e09b069
commit
10f1ee8518
2 changed files with 12 additions and 22 deletions
|
@ -39,7 +39,7 @@ import java.time.format.DateTimeFormatter
|
|||
/**
|
||||
* The `TellMessage` class.
|
||||
*/
|
||||
class TellMessage internal constructor(
|
||||
class TellMessage(
|
||||
/**
|
||||
* Returns the message's sender.
|
||||
*/
|
||||
|
|
|
@ -41,31 +41,31 @@ import java.util.Date
|
|||
/**
|
||||
* The class used to store link entries.
|
||||
*/
|
||||
class EntryLink : Serializable {
|
||||
class EntryLink(
|
||||
// Link's comments
|
||||
val comments: MutableList<EntryComment> = mutableListOf()
|
||||
val comments: MutableList<EntryComment> = mutableListOf(),
|
||||
|
||||
// Tags/categories
|
||||
val tags: MutableList<SyndCategory> = mutableListOf()
|
||||
val tags: MutableList<SyndCategory> = mutableListOf(),
|
||||
|
||||
// Channel
|
||||
var channel: String
|
||||
var channel: String,
|
||||
|
||||
// Creation date
|
||||
var date: Date = Calendar.getInstance().time
|
||||
var date: Date = Calendar.getInstance().time,
|
||||
|
||||
// Link's URL
|
||||
var link: String
|
||||
var link: String,
|
||||
|
||||
// Author's login
|
||||
var login = ""
|
||||
var login: String = "",
|
||||
|
||||
// Author's nickname
|
||||
var nick: String
|
||||
var nick: String,
|
||||
|
||||
// Link's title
|
||||
var title: String
|
||||
|
||||
) : Serializable {
|
||||
/**
|
||||
* Creates a new entry.
|
||||
*/
|
||||
|
@ -76,12 +76,7 @@ class EntryLink : Serializable {
|
|||
login: String,
|
||||
channel: String,
|
||||
tags: List<String?>
|
||||
) {
|
||||
this.link = link
|
||||
this.title = title
|
||||
this.nick = nick
|
||||
this.login = login
|
||||
this.channel = channel
|
||||
) : this(link = link, title = title, nick = nick, login = login, channel = channel) {
|
||||
setTags(tags)
|
||||
}
|
||||
|
||||
|
@ -95,12 +90,7 @@ class EntryLink : Serializable {
|
|||
channel: String,
|
||||
date: Date,
|
||||
tags: List<SyndCategory>
|
||||
) {
|
||||
this.link = link
|
||||
this.title = title
|
||||
this.nick = nick
|
||||
this.channel = channel
|
||||
this.date = Date(date.time)
|
||||
) : this(link = link, title = title, nick = nick, channel = channel, date = Date(date.time)) {
|
||||
this.tags.addAll(tags)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue