Made config constructor private
This commit is contained in:
parent
cfa49e7e3e
commit
1bcef5083f
1 changed files with 8 additions and 17 deletions
|
@ -34,22 +34,13 @@ package net.thauvin.erik.isgd
|
||||||
/**
|
/**
|
||||||
* Provides a builder to create/lookup an is.gd shortlink.
|
* Provides a builder to create/lookup an is.gd shortlink.
|
||||||
*/
|
*/
|
||||||
class Config(
|
class Config private constructor(builder: Builder) {
|
||||||
var url: String = "",
|
val url: String = builder.url
|
||||||
var shorturl: String = "",
|
val shorturl: String = builder.shorturl
|
||||||
var callback: String = "",
|
val callback: String = builder.callback
|
||||||
var logstats: Boolean = false,
|
val logstats: Boolean = builder.logstats
|
||||||
var format: Format = Format.SIMPLE,
|
val format: Format = builder.format
|
||||||
var isVgd: Boolean = false
|
val isVgd: Boolean = builder.isVgd
|
||||||
) {
|
|
||||||
constructor(builder: Builder) : this() {
|
|
||||||
url = builder.url
|
|
||||||
shorturl = builder.shorturl
|
|
||||||
callback = builder.callback
|
|
||||||
logstats = builder.logstats
|
|
||||||
format = builder.format
|
|
||||||
isVgd = builder.isVgd
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configures the parameters to create/lookup an is.gd shortlink.
|
* Configures the parameters to create/lookup an is.gd shortlink.
|
||||||
|
@ -73,7 +64,7 @@ class Config(
|
||||||
/**
|
/**
|
||||||
* You can specify the shorturl parameter if you'd like to pick a shortened URL instead of
|
* You can specify the shorturl parameter if you'd like to pick a shortened URL instead of
|
||||||
* having is.gd randomly generate one. These must be between 5 and 30 characters long and can only contain
|
* having is.gd randomly generate one. These must be between 5 and 30 characters long and can only contain
|
||||||
* alphanumeric characters and underscores. Shortened URLs are case sensitive. Bear in mind that a desired
|
* alphanumeric characters and underscores. Shortened URLs are case-sensitive. Bear in mind that a desired
|
||||||
* short URL might already be taken (this is very often the case with common words) so if you're using this
|
* short URL might already be taken (this is very often the case with common words) so if you're using this
|
||||||
* option be prepared to respond to an error and get an alternative choice from your app's user.
|
* option be prepared to respond to an error and get an alternative choice from your app's user.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue