Refine '?' use in Kotlin code
This commit is contained in:
committed by
Phillip Webb
parent
7035c0fa0a
commit
0510cfa684
@@ -21,7 +21,7 @@ import org.springframework.data.domain.Pageable
|
||||
import org.springframework.data.repository.Repository
|
||||
|
||||
interface CityRepository :
|
||||
Repository<City?, Long?> {
|
||||
fun findAll(pageable: Pageable?): Page<City?>?
|
||||
fun findByNameAndStateAllIgnoringCase(name: String?, state: String?): City?
|
||||
Repository<City, Long> {
|
||||
fun findAll(pageable: Pageable?): Page<City>
|
||||
fun findByNameAndStateAllIgnoringCase(name: String, state: String): City?
|
||||
}
|
||||
@@ -23,9 +23,9 @@ import org.springframework.data.repository.Repository
|
||||
import org.springframework.data.repository.history.RevisionRepository
|
||||
|
||||
interface CountryRepository :
|
||||
RevisionRepository<Country?, Long?, Int>,
|
||||
Repository<Country?, Long?> {
|
||||
RevisionRepository<Country, Long, Int>,
|
||||
Repository<Country, Long> {
|
||||
|
||||
fun findAll(pageable: Pageable?): Page<Country?>?
|
||||
fun findAll(pageable: Pageable?): Page<Country>?
|
||||
|
||||
}
|
||||
@@ -21,9 +21,9 @@ import org.springframework.data.domain.Page
|
||||
import org.springframework.data.domain.Pageable
|
||||
import org.springframework.data.repository.Repository
|
||||
|
||||
interface CityRepository : Repository<City?, Long?> {
|
||||
interface CityRepository : Repository<City, Long> {
|
||||
|
||||
fun findAll(pageable: Pageable?): Page<City?>?
|
||||
fun findAll(pageable: Pageable?): Page<City>?
|
||||
|
||||
fun findByNameAndStateAllIgnoringCase(name: String?, state: String?): City?
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ package org.springframework.boot.docs.data.sql.r2dbc.repositories
|
||||
import org.springframework.data.repository.Repository
|
||||
import reactor.core.publisher.Mono
|
||||
|
||||
interface CityRepository : Repository<City?, Long?> {
|
||||
interface CityRepository : Repository<City, Long> {
|
||||
|
||||
fun findByNameAndStateAllIgnoringCase(name: String?, state: String?): Mono<City?>?
|
||||
fun findByNameAndStateAllIgnoringCase(name: String, state: String): Mono<City?>
|
||||
|
||||
}
|
||||
@@ -29,7 +29,7 @@ class MyService(restClientBuilder: RestClient.Builder) {
|
||||
restClient = restClientBuilder.baseUrl("https://example.org").build()
|
||||
}
|
||||
|
||||
fun someRestCall(name: String?): Details {
|
||||
fun someRestCall(name: String): Details {
|
||||
return restClient.get().uri("/{name}/details", name)
|
||||
.retrieve().body(Details::class.java)!!
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ class MyService(restClientBuilder: RestClient.Builder, ssl: RestClientSsl) {
|
||||
.apply(ssl.fromBundle("mybundle")).build()
|
||||
}
|
||||
|
||||
fun someRestCall(name: String?): Details {
|
||||
fun someRestCall(name: String): Details {
|
||||
return restClient.get().uri("/{name}/details", name)
|
||||
.retrieve().body(Details::class.java)!!
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ class MyService(restClientBuilder: RestClient.Builder, sslBundles: SslBundles) {
|
||||
.requestFactory(requestFactory).build()
|
||||
}
|
||||
|
||||
fun someRestCall(name: String?): Details {
|
||||
fun someRestCall(name: String): Details {
|
||||
return restClient.get().uri("/{name}/details", name).retrieve().body(Details::class.java)!!
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ class MyService(webClientBuilder: WebClient.Builder) {
|
||||
webClient = webClientBuilder.baseUrl("https://example.org").build()
|
||||
}
|
||||
|
||||
fun someRestCall(name: String?): Mono<Details> {
|
||||
fun someRestCall(name: String): Mono<Details> {
|
||||
return webClient.get().uri("/{name}/details", name)
|
||||
.retrieve().bodyToMono(Details::class.java)
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ class MyService(webClientBuilder: WebClient.Builder, ssl: WebClientSsl) {
|
||||
.apply(ssl.fromBundle("mybundle")).build()
|
||||
}
|
||||
|
||||
fun someRestCall(name: String?): Mono<Details> {
|
||||
fun someRestCall(name: String): Mono<Details> {
|
||||
return webClient.get().uri("/{name}/details", name)
|
||||
.retrieve().bodyToMono(Details::class.java)
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ class MyKafkaStreamsConfiguration {
|
||||
return stream
|
||||
}
|
||||
|
||||
private fun uppercaseValue(key: Int, value: String): KeyValue<Int?, String?> {
|
||||
private fun uppercaseValue(key: Int, value: String): KeyValue<Int, String> {
|
||||
return KeyValue(key, value.uppercase())
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ package org.springframework.boot.docs.web.reactive.webflux
|
||||
import org.springframework.data.repository.reactive.ReactiveCrudRepository
|
||||
import reactor.core.publisher.Flux
|
||||
|
||||
interface CustomerRepository : ReactiveCrudRepository<Customer?, Long?> {
|
||||
interface CustomerRepository : ReactiveCrudRepository<Customer, Long> {
|
||||
|
||||
fun findByUser(user: User?): Flux<Customer?>?
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ import reactor.core.publisher.Mono
|
||||
class MyRestController(private val userRepository: UserRepository, private val customerRepository: CustomerRepository) {
|
||||
|
||||
@GetMapping("/{userId}")
|
||||
fun getUser(@PathVariable userId: Long): Mono<User?> {
|
||||
fun getUser(@PathVariable userId: Long): Mono<User> {
|
||||
return userRepository.findById(userId)
|
||||
}
|
||||
|
||||
|
||||
@@ -18,4 +18,4 @@ package org.springframework.boot.docs.web.reactive.webflux
|
||||
|
||||
import org.springframework.data.repository.reactive.ReactiveCrudRepository
|
||||
|
||||
interface UserRepository : ReactiveCrudRepository<User?, Long?>
|
||||
interface UserRepository : ReactiveCrudRepository<User, Long>
|
||||
|
||||
@@ -18,7 +18,7 @@ package org.springframework.boot.docs.web.servlet.springmvc
|
||||
|
||||
import org.springframework.data.repository.CrudRepository
|
||||
|
||||
interface CustomerRepository : CrudRepository<Customer?, Long?> {
|
||||
interface CustomerRepository : CrudRepository<Customer, Long> {
|
||||
|
||||
fun findByUser(user: User?): List<Customer>?
|
||||
|
||||
|
||||
@@ -18,4 +18,4 @@ package org.springframework.boot.docs.web.servlet.springmvc
|
||||
|
||||
import org.springframework.data.repository.CrudRepository
|
||||
|
||||
interface UserRepository : CrudRepository<User?, Long?>
|
||||
interface UserRepository : CrudRepository<User, Long>
|
||||
|
||||
Reference in New Issue
Block a user