Made config constructor private

This commit is contained in:
Erik C. Thauvin 2024-05-26 00:25:49 -07:00
parent 56a8cbd7f7
commit 19956a337f
Signed by: erik
GPG key ID: 776702A6A2DA330E

View file

@ -35,47 +35,25 @@ import net.thauvin.erik.akismet.AkismetComment.Companion.ADMIN_ROLE
/** /**
* Provides a comment configuration. * Provides a comment configuration.
*
* @param userIp IP address of the comment submitter.
* @param userAgent User agent string of the web browser submitting the comment.
*/ */
class CommentConfig @JvmOverloads constructor( class CommentConfig private constructor(builder: Builder) {
var userIp: String, val userIp: String = builder.userIp
var userAgent: String, val userAgent: String = builder.userAgent
var referrer: String = "", val referrer = builder.referrer
var permalink: String = "", val permalink = builder.permalink
var type: CommentType = CommentType.NONE, val type = builder.type
var author: String = "", val author = builder.author
var authorEmail: String = "", val authorEmail = builder.authorEmail
var authorUrl: String = "", val authorUrl = builder.authorUrl
var content: String = "", val content = builder.content
var dateGmt: String = "", val dateGmt = builder.dateGmt
var postModifiedGmt: String = "", val postModifiedGmt = builder.postModifiedGmt
var blogLang: String = "", val blogLang = builder.blogLang
var blogCharset: String = "", val blogCharset = builder.blogCharset
var userRole: String = "", val userRole = builder.userRole
var isTest: Boolean = false, val isTest = builder.isTest
var recheckReason: String = "", val recheckReason = builder.recheckReason
var serverEnv: Map<String, String> = emptyMap() val serverEnv = builder.serverEnv
) {
constructor(builder: Builder) : this(builder.userIp, builder.userAgent) {
referrer = builder.referrer
permalink = builder.permalink
type = builder.type
author = builder.author
authorEmail = builder.authorEmail
authorUrl = builder.authorUrl
content = builder.content
dateGmt = builder.dateGmt
postModifiedGmt = builder.postModifiedGmt
blogLang = builder.blogLang
blogCharset = builder.blogCharset
userRole = builder.userRole
isTest = builder.isTest
recheckReason = builder.recheckReason
serverEnv = builder.serverEnv
}
/** /**
* Provides a configuration builder. * Provides a configuration builder.