diff --git a/src/main/java/com/github/doomsdayrs/jikan4java/core/Retriever.kt b/src/main/java/com/github/doomsdayrs/jikan4java/core/Retriever.kt index 8234581..ea8fdfe 100644 --- a/src/main/java/com/github/doomsdayrs/jikan4java/core/Retriever.kt +++ b/src/main/java/com/github/doomsdayrs/jikan4java/core/Retriever.kt @@ -38,10 +38,10 @@ import java.util.concurrent.CompletionException * @author github.com/doomsdayrs */ class Retriever( - val client: OkHttpClient = getDefaultOkHttpClient(), + private val client: OkHttpClient = getDefaultOkHttpClient(), @Suppress("MemberVisibilityCanBePrivate") - val builder: Request.Builder = getDefaultRequestBuilder(), - val format: Json = getDefaultJSONParser(), + private val builder: Request.Builder = getDefaultRequestBuilder(), + private val format: Json = getDefaultJSONParser(), ) { /** @@ -51,17 +51,17 @@ class Retriever( * @return response from jikan * @throws IOException something went wrong */ - fun request(url: String): ResponseBody? { + internal fun request(url: String): ResponseBody? { println(url) val request: Request = builder.url(url).build() val call = client.newCall(request) return call.execute().body } - inline operator fun invoke(url: String) = + internal inline operator fun invoke(url: String) = retrieve(url) - inline fun retrieve( + internal inline fun retrieve( url: String ): JCompletableFuture = GlobalScope.future { var response = ""