Rename @DurationUnit -> @DefaultDurationUnit
Rename `@DurationUnit` to `@DefaultDurationUnit` to make it clearer that it only changes the unit if one isn't specified by the user. Closes gh-11078
This commit is contained in:
@@ -24,7 +24,7 @@ import java.util.List;
|
||||
import org.springframework.amqp.core.AcknowledgeMode;
|
||||
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory.CacheMode;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.context.properties.bind.convert.DurationUnit;
|
||||
import org.springframework.boot.context.properties.bind.convert.DefaultDurationUnit;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@@ -80,7 +80,7 @@ public class RabbitProperties {
|
||||
* Requested heartbeat timeout; zero for none. If a duration suffix is not specified,
|
||||
* seconds will be used.
|
||||
*/
|
||||
@DurationUnit(ChronoUnit.SECONDS)
|
||||
@DefaultDurationUnit(ChronoUnit.SECONDS)
|
||||
private Duration requestedHeartbeat;
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,7 +28,7 @@ import com.datastax.driver.core.policies.ReconnectionPolicy;
|
||||
import com.datastax.driver.core.policies.RetryPolicy;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.context.properties.bind.convert.DurationUnit;
|
||||
import org.springframework.boot.context.properties.bind.convert.DefaultDurationUnit;
|
||||
|
||||
/**
|
||||
* Configuration properties for Cassandra.
|
||||
@@ -283,7 +283,7 @@ public class CassandraProperties {
|
||||
* Idle timeout before an idle connection is removed. If a duration suffix is not
|
||||
* specified, seconds will be used.
|
||||
*/
|
||||
@DurationUnit(ChronoUnit.SECONDS)
|
||||
@DefaultDurationUnit(ChronoUnit.SECONDS)
|
||||
private Duration idleTimeout = Duration.ofSeconds(120);
|
||||
|
||||
/**
|
||||
@@ -296,7 +296,7 @@ public class CassandraProperties {
|
||||
* sure it's still alive. If a duration suffix is not specified, seconds will be
|
||||
* used.
|
||||
*/
|
||||
@DurationUnit(ChronoUnit.SECONDS)
|
||||
@DefaultDurationUnit(ChronoUnit.SECONDS)
|
||||
private Duration heartbeatInterval = Duration.ofSeconds(30);
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,7 +20,7 @@ import java.time.Duration;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.context.properties.bind.convert.DurationUnit;
|
||||
import org.springframework.boot.context.properties.bind.convert.DefaultDurationUnit;
|
||||
|
||||
/**
|
||||
* Configuration properties for JDBC.
|
||||
@@ -58,7 +58,7 @@ public class JdbcProperties {
|
||||
* Query timeout. Default is to use the JDBC driver's default configuration. If a
|
||||
* duration suffix is not specified, seconds will be used.
|
||||
*/
|
||||
@DurationUnit(ChronoUnit.SECONDS)
|
||||
@DefaultDurationUnit(ChronoUnit.SECONDS)
|
||||
private Duration queryTimeout;
|
||||
|
||||
public int getFetchSize() {
|
||||
|
||||
@@ -20,7 +20,7 @@ import java.time.Duration;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.context.properties.bind.convert.DurationUnit;
|
||||
import org.springframework.boot.context.properties.bind.convert.DefaultDurationUnit;
|
||||
import org.springframework.transaction.support.AbstractPlatformTransactionManager;
|
||||
|
||||
/**
|
||||
@@ -39,7 +39,7 @@ public class TransactionProperties implements
|
||||
* Default transaction timeout. If a duration suffix is not specified, seconds will be
|
||||
* used.
|
||||
*/
|
||||
@DurationUnit(ChronoUnit.SECONDS)
|
||||
@DefaultDurationUnit(ChronoUnit.SECONDS)
|
||||
private Duration defaultTimeout;
|
||||
|
||||
/**
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.time.temporal.ChronoUnit;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.context.properties.bind.convert.DurationUnit;
|
||||
import org.springframework.boot.context.properties.bind.convert.DefaultDurationUnit;
|
||||
import org.springframework.http.CacheControl;
|
||||
|
||||
/**
|
||||
@@ -52,7 +52,7 @@ public class ResourceProperties {
|
||||
* If a duration suffix is not specified, seconds will be used.
|
||||
* Can be overridden by the {@code cache-control} property.
|
||||
*/
|
||||
@DurationUnit(ChronoUnit.SECONDS)
|
||||
@DefaultDurationUnit(ChronoUnit.SECONDS)
|
||||
private Duration cachePeriod;
|
||||
|
||||
/**
|
||||
@@ -300,7 +300,7 @@ public class ResourceProperties {
|
||||
* Maximum time the response should be cached,
|
||||
* in seconds if no duration suffix is not specified.
|
||||
*/
|
||||
@DurationUnit(ChronoUnit.SECONDS)
|
||||
@DefaultDurationUnit(ChronoUnit.SECONDS)
|
||||
private Duration maxAge;
|
||||
|
||||
/**
|
||||
@@ -347,21 +347,21 @@ public class ResourceProperties {
|
||||
* Maximum time the response can be served after it becomes stale,
|
||||
* in seconds if no duration suffix is not specified.
|
||||
*/
|
||||
@DurationUnit(ChronoUnit.SECONDS)
|
||||
@DefaultDurationUnit(ChronoUnit.SECONDS)
|
||||
private Duration staleWhileRevalidate;
|
||||
|
||||
/**
|
||||
* Maximum time the response may be used when errors are encountered,
|
||||
* in seconds if no duration suffix is not specified.
|
||||
*/
|
||||
@DurationUnit(ChronoUnit.SECONDS)
|
||||
@DefaultDurationUnit(ChronoUnit.SECONDS)
|
||||
private Duration staleIfError;
|
||||
|
||||
/**
|
||||
* Maximum time the response should be cached by shared caches,
|
||||
* in seconds if no duration suffix is not specified.
|
||||
*/
|
||||
@DurationUnit(ChronoUnit.SECONDS)
|
||||
@DefaultDurationUnit(ChronoUnit.SECONDS)
|
||||
private Duration sMaxAge;
|
||||
|
||||
public Duration getMaxAge() {
|
||||
|
||||
@@ -32,7 +32,7 @@ import java.util.TimeZone;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.context.properties.NestedConfigurationProperty;
|
||||
import org.springframework.boot.context.properties.bind.convert.DurationUnit;
|
||||
import org.springframework.boot.context.properties.bind.convert.DefaultDurationUnit;
|
||||
import org.springframework.boot.web.server.Compression;
|
||||
import org.springframework.boot.web.server.Http2;
|
||||
import org.springframework.boot.web.server.Ssl;
|
||||
@@ -340,7 +340,7 @@ public class ServerProperties {
|
||||
/**
|
||||
* Session timeout. If a duration suffix is not specified, seconds will be used.
|
||||
*/
|
||||
@DurationUnit(ChronoUnit.SECONDS)
|
||||
@DefaultDurationUnit(ChronoUnit.SECONDS)
|
||||
private Duration timeout;
|
||||
|
||||
/**
|
||||
@@ -434,7 +434,7 @@ public class ServerProperties {
|
||||
/**
|
||||
* Maximum age of the session cookie.
|
||||
*/
|
||||
@DurationUnit(ChronoUnit.SECONDS)
|
||||
@DefaultDurationUnit(ChronoUnit.SECONDS)
|
||||
private Duration maxAge;
|
||||
|
||||
public String getName() {
|
||||
@@ -570,7 +570,7 @@ public class ServerProperties {
|
||||
* Delay between the invocation of backgroundProcess methods. If a duration suffix
|
||||
* is not specified, seconds will be used.
|
||||
*/
|
||||
@DurationUnit(ChronoUnit.SECONDS)
|
||||
@DefaultDurationUnit(ChronoUnit.SECONDS)
|
||||
private Duration backgroundProcessorDelay = Duration.ofSeconds(30);
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user