1
mirror of https://github.com/CarmJos/EasyConfiguration.git synced 2024-09-19 20:25:51 +00:00

feat(builder): 提供Functional形式提供defaultValue的方法。

This commit is contained in:
Carm Jos 2023-01-16 19:26:07 +08:00
parent 96e90dd71b
commit 1232c7c4da
7 changed files with 11 additions and 6 deletions

View File

@ -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>

View File

@ -7,6 +7,7 @@ import org.jetbrains.annotations.Nullable;
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<?>> {
@ -61,4 +62,8 @@ public abstract class AbstractConfigBuilder<T, B extends AbstractConfigBuilder<T
return getThis();
}
public @NotNull B defaults(@NotNull Supplier<T> defaultValueSupplier) {
return defaults(defaultValueSupplier.get());
}
}

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>