Add missing RestOperations extensions
Issue: SPR-16229
This commit is contained in:
@@ -59,6 +59,17 @@ inline fun <reified T: Any> RestOperations.getForObject(url: String, uriVariable
|
||||
inline fun <reified T: Any> RestOperations.getForObject(url: URI): T? =
|
||||
getForObject(url, T::class.java)
|
||||
|
||||
/**
|
||||
* Extension for [RestOperations.getForEntity] avoiding requiring the type parameter
|
||||
* thanks to Kotlin reified type parameters.
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
* @since 5.0.2
|
||||
*/
|
||||
@Throws(RestClientException::class)
|
||||
inline fun <reified T: Any> RestOperations.getForEntity(url: URI): ResponseEntity<T> =
|
||||
getForEntity(url, T::class.java)
|
||||
|
||||
/**
|
||||
* Extension for [RestOperations.getForEntity] avoiding requiring the type parameter
|
||||
* thanks to Kotlin reified type parameters.
|
||||
@@ -71,6 +82,50 @@ inline fun <reified T: Any> RestOperations.getForObject(url: URI): T? =
|
||||
inline fun <reified T: Any> RestOperations.getForEntity(url: String, vararg uriVariables: Any): ResponseEntity<T> =
|
||||
getForEntity(url, T::class.java, *uriVariables)
|
||||
|
||||
/**
|
||||
* Extension for [RestOperations.getForEntity] avoiding requiring the type parameter
|
||||
* thanks to Kotlin reified type parameters.
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
* @since 5.0.2
|
||||
*/
|
||||
@Throws(RestClientException::class)
|
||||
inline fun <reified T: Any> RestOperations.getForEntity(url: String, uriVariables: Map<String, *>): ResponseEntity<T> =
|
||||
getForEntity(url, T::class.java, uriVariables)
|
||||
|
||||
/**
|
||||
* Extension for [RestOperations.patchForObject] avoiding specifying the type parameter
|
||||
* thanks to Kotlin reified type parameters.
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
* @since 5.0.2
|
||||
*/
|
||||
@Throws(RestClientException::class)
|
||||
inline fun <reified T: Any> RestOperations.patchForObject(url: String, request: Any, vararg uriVariables: Any): T? =
|
||||
patchForObject(url, request, T::class.java, *uriVariables)
|
||||
|
||||
/**
|
||||
* Extension for [RestOperations.patchForObject] avoiding specifying the type parameter
|
||||
* thanks to Kotlin reified type parameters.
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
* @since 5.0.2
|
||||
*/
|
||||
@Throws(RestClientException::class)
|
||||
inline fun <reified T: Any> RestOperations.patchForObject(url: String, request: Any, uriVariables: Map<String, *>): T? =
|
||||
patchForObject(url, request, T::class.java, uriVariables)
|
||||
|
||||
/**
|
||||
* Extension for [RestOperations.patchForObject] avoiding specifying the type parameter
|
||||
* thanks to Kotlin reified type parameters.
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
* @since 5.0.2
|
||||
*/
|
||||
@Throws(RestClientException::class)
|
||||
inline fun <reified T: Any> RestOperations.patchForObject(url: URI, request: Any): T? =
|
||||
patchForObject(url, request, T::class.java)
|
||||
|
||||
/**
|
||||
* Extension for [RestOperations.postForObject] avoiding specifying the type parameter
|
||||
* thanks to Kotlin reified type parameters.
|
||||
|
||||
Reference in New Issue
Block a user