Removes use of javax.validation
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -177,7 +177,7 @@
|
||||
</dependencyManagement>
|
||||
|
||||
<properties>
|
||||
<spring-cloud-build.version>2.2.3.RELEASE</spring-cloud-build.version>
|
||||
<spring-cloud-build.version>2.3.0.BUILD-SNAPSHOT</spring-cloud-build.version>
|
||||
<spring-cloud-commons.version>2.2.3.BUILD-SNAPSHOT</spring-cloud-commons.version>
|
||||
<spring-cloud-config.version>2.2.3.BUILD-SNAPSHOT</spring-cloud-config.version>
|
||||
<spring-cloud-netflix.version>2.2.3.BUILD-SNAPSHOT</spring-cloud-netflix.version>
|
||||
|
||||
@@ -16,10 +16,8 @@
|
||||
|
||||
package org.springframework.cloud.zookeeper.config;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* Properties related to keeping configuration in Zookeeper.
|
||||
@@ -28,7 +26,6 @@ import org.springframework.validation.annotation.Validated;
|
||||
* @since 1.0.0
|
||||
* @see ZookeeperPropertySourceLocator
|
||||
*/
|
||||
@Validated
|
||||
@ConfigurationProperties("spring.cloud.zookeeper.config")
|
||||
public class ZookeeperConfigProperties {
|
||||
|
||||
@@ -42,13 +39,11 @@ public class ZookeeperConfigProperties {
|
||||
/**
|
||||
* The name of the default context.
|
||||
*/
|
||||
@NotEmpty
|
||||
private String defaultContext = "application";
|
||||
|
||||
/**
|
||||
* Separator for profile appended to the application name.
|
||||
*/
|
||||
@NotEmpty
|
||||
private String profileSeparator = ",";
|
||||
|
||||
/**
|
||||
@@ -85,10 +80,12 @@ public class ZookeeperConfigProperties {
|
||||
}
|
||||
|
||||
public void setDefaultContext(String defaultContext) {
|
||||
Assert.hasText(defaultContext, "spring.cloud.zookeeper.config.default-context may not be empty");
|
||||
this.defaultContext = defaultContext;
|
||||
}
|
||||
|
||||
public void setProfileSeparator(String profileSeparator) {
|
||||
Assert.hasText(profileSeparator, "spring.cloud.zookeeper.config.profile-separator may not be empty");
|
||||
this.profileSeparator = profileSeparator;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,11 +20,9 @@ import java.time.Duration;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.convert.DurationUnit;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* Properties related to connecting to Zookeeper.
|
||||
@@ -32,14 +30,12 @@ import org.springframework.validation.annotation.Validated;
|
||||
* @author Spencer Gibb
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Validated
|
||||
@ConfigurationProperties("spring.cloud.zookeeper")
|
||||
public class ZookeeperProperties {
|
||||
|
||||
/**
|
||||
* Connection string to the Zookeeper cluster.
|
||||
*/
|
||||
@NotNull
|
||||
private String connectString = "localhost:2181";
|
||||
|
||||
/**
|
||||
@@ -118,6 +114,7 @@ public class ZookeeperProperties {
|
||||
}
|
||||
|
||||
public void setConnectString(String connectString) {
|
||||
Assert.hasText(connectString, "spring.cloud.zookeeper.connect-string may not be empty");
|
||||
this.connectString = connectString;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user