Skip to content

Commit

Permalink
Added return types to builders functions
Browse files Browse the repository at this point in the history
  • Loading branch information
ethauvin committed May 19, 2024
1 parent f41c988 commit 9e25537
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
14 changes: 7 additions & 7 deletions src/main/kotlin/net/thauvin/erik/bitly/config/CreateConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -71,28 +71,28 @@ class CreateConfig private constructor(builder: Builder) {
/**
* A branded short domain or `bit.ly` by default.
*/
fun domain(domain: String) = apply { this.domain = domain }
fun domain(domain: String): Builder = apply { this.domain = domain }

/**
* Always include a specific group and custom domain in your shorten calls.
*/
fun groupGuid(group_guid: String) = apply { this.group_guid = group_guid }
fun groupGuid(group_guid: String): Builder = apply { this.group_guid = group_guid }

fun title(title: String) = apply { this.title = title }
fun title(title: String): Builder = apply { this.title = title }

fun tags(tags: Array<String>) = apply { this.tags = tags }
fun tags(tags: Array<String>): Builder = apply { this.tags = tags }

fun deeplinks(deeplinks: Array<Map<String, String>>) = apply { this.deeplinks = deeplinks }
fun deeplinks(deeplinks: Array<Map<String, String>>): Builder = apply { this.deeplinks = deeplinks }

/**
* The long URL.
*/
fun longUrl(long_url: String) = apply { this.long_url = long_url }
fun longUrl(long_url: String): Builder = apply { this.long_url = long_url }

/**
* Returns the full JSON response if `true`.
*/
fun toJson(toJson: Boolean) = apply { this.toJson = toJson }
fun toJson(toJson: Boolean): Builder = apply { this.toJson = toJson }

/**
* Builds the configuration.
Expand Down
12 changes: 6 additions & 6 deletions src/main/kotlin/net/thauvin/erik/bitly/config/UpdateConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,17 @@ class UpdateConfig private constructor(builder: Builder) {
/**
* A Bitlink made of the domain and hash.
*/
fun bitlink(bitlink: String) = apply { this.bitlink = bitlink }
fun bitlink(bitlink: String): Builder = apply { this.bitlink = bitlink }

fun title(title: String) = apply { this.title = title }
fun archived(archived: Boolean) = apply { this.archived = archived }
fun tags(tags: Array<String>) = apply { this.tags = tags }
fun deepLinks(deepLinks: Array<Map<String, String>>) = apply { this.deeplinks = deepLinks }
fun title(title: String): Builder = apply { this.title = title }
fun archived(archived: Boolean): Builder = apply { this.archived = archived }
fun tags(tags: Array<String>): Builder = apply { this.tags = tags }
fun deepLinks(deepLinks: Array<Map<String, String>>): Builder = apply { this.deeplinks = deepLinks }

/**
* Returns the full JSON response if `true`.
*/
fun toJson(toJson: Boolean) = apply { this.toJson = toJson }
fun toJson(toJson: Boolean): Builder = apply { this.toJson = toJson }

/**
* Builds the configuration.
Expand Down

0 comments on commit 9e25537

Please sign in to comment.