Cleaned up constructors.

This commit is contained in:
Erik C. Thauvin 2021-11-28 23:18:28 -08:00
parent 4e1e09b069
commit 10f1ee8518
2 changed files with 12 additions and 22 deletions

View file

@ -39,7 +39,7 @@ import java.time.format.DateTimeFormatter
/** /**
* The `TellMessage` class. * The `TellMessage` class.
*/ */
class TellMessage internal constructor( class TellMessage(
/** /**
* Returns the message's sender. * Returns the message's sender.
*/ */

View file

@ -41,31 +41,31 @@ import java.util.Date
/** /**
* The class used to store link entries. * The class used to store link entries.
*/ */
class EntryLink : Serializable { class EntryLink(
// Link's comments // Link's comments
val comments: MutableList<EntryComment> = mutableListOf() val comments: MutableList<EntryComment> = mutableListOf(),
// Tags/categories // Tags/categories
val tags: MutableList<SyndCategory> = mutableListOf() val tags: MutableList<SyndCategory> = mutableListOf(),
// Channel // Channel
var channel: String var channel: String,
// Creation date // Creation date
var date: Date = Calendar.getInstance().time var date: Date = Calendar.getInstance().time,
// Link's URL // Link's URL
var link: String var link: String,
// Author's login // Author's login
var login = "" var login: String = "",
// Author's nickname // Author's nickname
var nick: String var nick: String,
// Link's title // Link's title
var title: String var title: String
) : Serializable {
/** /**
* Creates a new entry. * Creates a new entry.
*/ */
@ -76,12 +76,7 @@ class EntryLink : Serializable {
login: String, login: String,
channel: String, channel: String,
tags: List<String?> tags: List<String?>
) { ) : this(link = link, title = title, nick = nick, login = login, channel = channel) {
this.link = link
this.title = title
this.nick = nick
this.login = login
this.channel = channel
setTags(tags) setTags(tags)
} }
@ -95,12 +90,7 @@ class EntryLink : Serializable {
channel: String, channel: String,
date: Date, date: Date,
tags: List<SyndCategory> tags: List<SyndCategory>
) { ) : this(link = link, title = title, nick = nick, channel = channel, date = Date(date.time)) {
this.link = link
this.title = title
this.nick = nick
this.channel = channel
this.date = Date(date.time)
this.tags.addAll(tags) this.tags.addAll(tags)
} }