Skip to content

Commit

Permalink
feat(builder): 提供Functional形式提供defaultValue的方法。
Browse files Browse the repository at this point in the history
  • Loading branch information
CarmJos committed Jan 16, 2023
1 parent 96e90dd commit 1232c7c
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>easyconfiguration-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<version>3.3.1</version>
<version>3.3.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import java.util.Arrays;
import java.util.List;
import java.util.function.Supplier;

public abstract class AbstractConfigBuilder<T, B extends AbstractConfigBuilder<T, B, P>, P extends ConfigurationProvider<?>> {

Expand Down Expand Up @@ -61,4 +62,8 @@ public AbstractConfigBuilder(Class<? super P> providerClass) {
return getThis();
}

public @NotNull B defaults(@NotNull Supplier<T> defaultValueSupplier) {
return defaults(defaultValueSupplier.get());
}

}
2 changes: 1 addition & 1 deletion demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>easyconfiguration-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<version>3.3.1</version>
<version>3.3.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<properties>
Expand Down
2 changes: 1 addition & 1 deletion impl/json/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>easyconfiguration-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<version>3.3.1</version>
<version>3.3.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion impl/sql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>easyconfiguration-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<version>3.3.1</version>
<version>3.3.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion impl/yaml/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>easyconfiguration-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<version>3.3.1</version>
<version>3.3.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<groupId>cc.carm.lib</groupId>
<artifactId>easyconfiguration-parent</artifactId>
<packaging>pom</packaging>
<version>3.3.1</version>
<version>3.3.2</version>
<modules>
<module>core</module>
<module>demo</module>
Expand Down

0 comments on commit 1232c7c

Please sign in to comment.