"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "spring-r2dbc/src/main/kotlin/org/springframework/r2dbc/core/RowsFetchSpecExtensions.kt" between
spring-framework-5.3.7.tar.gz and spring-framework-5.3.8.tar.gz

About: Spring Framework is an application framework for the Java platform and .NET Framework. Community edition.

RowsFetchSpecExtensions.kt  (spring-framework-5.3.7):RowsFetchSpecExtensions.kt  (spring-framework-5.3.8)
/* /*
* Copyright 2002-2020 the original author or authors. * Copyright 2002-2021 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* https://www.apache.org/licenses/LICENSE-2.0 * https://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
skipping to change at line 28 skipping to change at line 28
import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.reactive.asFlow import kotlinx.coroutines.reactive.asFlow
import kotlinx.coroutines.reactive.awaitSingleOrNull import kotlinx.coroutines.reactive.awaitSingleOrNull
import org.springframework.dao.EmptyResultDataAccessException import org.springframework.dao.EmptyResultDataAccessException
/** /**
* Non-nullable Coroutines variant of [RowsFetchSpec.one]. * Non-nullable Coroutines variant of [RowsFetchSpec.one].
* *
* @author Sebastien Deleuze * @author Sebastien Deleuze
*/ */
@Suppress("DEPRECATION")
suspend fun <T> RowsFetchSpec<T>.awaitOne(): T { suspend fun <T> RowsFetchSpec<T>.awaitOne(): T {
return one().awaitSingleOrNull() ?: throw EmptyResultDataAccessException( 1) return one().awaitSingleOrNull() ?: throw EmptyResultDataAccessException( 1)
} }
/** /**
* Nullable Coroutines variant of [RowsFetchSpec.one]. * Nullable Coroutines variant of [RowsFetchSpec.one].
* *
* @author Sebastien Deleuze * @author Sebastien Deleuze
*/ */
@Suppress("DEPRECATION")
suspend fun <T> RowsFetchSpec<T>.awaitOneOrNull(): T? = suspend fun <T> RowsFetchSpec<T>.awaitOneOrNull(): T? =
one().awaitSingleOrNull() one().awaitSingleOrNull()
/** /**
* Non-nullable Coroutines variant of [RowsFetchSpec.first]. * Non-nullable Coroutines variant of [RowsFetchSpec.first].
* *
* @author Sebastien Deleuze * @author Sebastien Deleuze
*/ */
@Suppress("DEPRECATION")
suspend fun <T> RowsFetchSpec<T>.awaitSingle(): T { suspend fun <T> RowsFetchSpec<T>.awaitSingle(): T {
return first().awaitSingleOrNull() ?: throw EmptyResultDataAccessExceptio n(1) return first().awaitSingleOrNull() ?: throw EmptyResultDataAccessExceptio n(1)
} }
/** /**
* Nullable Coroutines variant of [RowsFetchSpec.first]. * Nullable Coroutines variant of [RowsFetchSpec.first].
* *
* @author Sebastien Deleuze * @author Sebastien Deleuze
*/ */
@Suppress("DEPRECATION")
suspend fun <T> RowsFetchSpec<T>.awaitSingleOrNull(): T? = suspend fun <T> RowsFetchSpec<T>.awaitSingleOrNull(): T? =
first().awaitSingleOrNull() first().awaitSingleOrNull()
/** /**
* Coroutines [Flow] variant of [RowsFetchSpec.all]. * Coroutines [Flow] variant of [RowsFetchSpec.all].
* *
* @author Sebastien Deleuze * @author Sebastien Deleuze
*/ */
fun <T : Any> RowsFetchSpec<T>.flow(): Flow<T> = all().asFlow() fun <T : Any> RowsFetchSpec<T>.flow(): Flow<T> = all().asFlow()
 End of changes. 5 change blocks. 
1 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)