Made config constructor private
This commit is contained in:
parent
56a8cbd7f7
commit
19956a337f
1 changed files with 18 additions and 40 deletions
|
@ -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.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue