Polishing.

Stick to TtlFunction & nullability contracts.
Update deprecation with since tag.

Original Pull Request: #2597
This commit is contained in:
Christoph Strobl
2023-07-10 09:26:47 +02:00
parent fe88d31d09
commit d25de89fec
2 changed files with 4 additions and 9 deletions

View File

@@ -334,16 +334,11 @@ public class RedisCacheConfiguration {
* was called during cache configuration.
*
* @return the configured {@link Duration TTL expiration}.
* @deprecated use {@link #getTtlFunction()} instead.
* @deprecated since 3.2.0. Use {@link #getTtlFunction()} instead.
*/
@Deprecated
@SuppressWarnings("all")
@Deprecated(since = "3.2.0")
public Duration getTtl() {
TtlFunction ttlFunction = getTtlFunction();
return ttlFunction instanceof FixedDurationTtlFunction it ? it.duration()
: ttlFunction.getTimeToLive(null, null);
return getTtlFunction().getTimeToLive(Object.class, null);
}
/**