@@ -111,7 +111,7 @@ internal fun String.byteEncode(): String {
111111
112112internal fun String.encode () = URLEncoder .encode(this , " UTF-8" )!!
113113
114- fun <T > Any.toObject (o : Any , tClazz : Class <T >): T {
114+ internal fun <T > Any.toObject (o : Any , tClazz : Class <T >): T {
115115 val obj = ((o as ? SpotifyAPI )?.gson ? : (o as ? Gson )
116116 ? : throw IllegalArgumentException (" Parameter must be a SpotifyAPI or Gson instance" ))
117117 .fromJson(this as String , tClazz)
@@ -122,14 +122,14 @@ fun <T> Any.toObject(o: Any, tClazz: Class<T>): T {
122122 return obj
123123}
124124
125- fun Any.instantiatePagingObjects (spotifyAPI : SpotifyAPI ) = when {
125+ internal fun Any.instantiatePagingObjects (spotifyAPI : SpotifyAPI ) = when {
126126 this is FeaturedPlaylists -> this .playlists
127127 this is Album -> this .tracks
128128 this is Playlist -> this .tracks
129129 else -> null
130130}.let { it?.endpoint = spotifyAPI.tracks; this }
131131
132- fun <T > String.toPagingObject (innerObjectName : String? = null, endpoint : SpotifyEndpoint , tClazz : Class <T >): PagingObject <T > {
132+ internal fun <T > String.toPagingObject (innerObjectName : String? = null, endpoint : SpotifyEndpoint , tClazz : Class <T >): PagingObject <T > {
133133 val jsonObject = if (innerObjectName != null ) JSONObject (this ).getJSONObject(innerObjectName) else JSONObject (this )
134134 val pagingObject= PagingObject (
135135 jsonObject.getString(" href" ),
@@ -144,7 +144,7 @@ fun <T> String.toPagingObject(innerObjectName: String? = null, endpoint: Spotify
144144 return pagingObject
145145}
146146
147- fun <T > String.toCursorBasedPagingObject (innerObjectName : String? = null, endpoint : SpotifyEndpoint , tClazz : Class <T >): CursorBasedPagingObject <T > {
147+ internal fun <T > String.toCursorBasedPagingObject (innerObjectName : String? = null, endpoint : SpotifyEndpoint , tClazz : Class <T >): CursorBasedPagingObject <T > {
148148 val jsonObject = if (innerObjectName != null ) JSONObject (this ).getJSONObject(innerObjectName) else JSONObject (this )
149149 val cursorBasedPagingObject= CursorBasedPagingObject (
150150 jsonObject.getString(" href" ),
@@ -158,18 +158,18 @@ fun <T> String.toCursorBasedPagingObject(innerObjectName: String? = null, endpoi
158158 return cursorBasedPagingObject
159159}
160160
161- fun <T > String.toLinkedResult (api : SpotifyAPI , tClazz : Class <T >): LinkedResult <T > {
161+ internal fun <T > String.toLinkedResult (api : SpotifyAPI , tClazz : Class <T >): LinkedResult <T > {
162162 val jsonObject = JSONObject (this )
163163 return LinkedResult (
164164 jsonObject.getString(" href" ),
165165 jsonObject.getJSONArray(" items" ).map { it.toString().toObject(api, tClazz) })
166166}
167167
168- fun <T > String.toInnerObject (innerName : String , api : SpotifyAPI , tClazz : Class <T >): List <T > {
168+ internal fun <T > String.toInnerObject (innerName : String , api : SpotifyAPI , tClazz : Class <T >): List <T > {
169169 return JSONObject (this ).getJSONArray(innerName).map { it.toString().toObject(api, tClazz) }
170170}
171171
172- fun <T > catch (function : () -> T ): T ? {
172+ internal fun <T > catch (function : () -> T ): T ? {
173173 return try {
174174 function()
175175 } catch (e: BadRequestException ) {
0 commit comments