From ab4d9cda4e93d867fddce18773a61aa25669b1ab Mon Sep 17 00:00:00 2001 From: Moritz Halbritter Date: Wed, 20 Jul 2022 16:49:42 +0200 Subject: [PATCH] Make configuration properties public --- .../example/configprops/AppProperties.java | 28 +++++++++---------- .../configprops/AppPropertiesCtor.java | 20 ++++++------- .../configprops/AppPropertiesRecord.java | 4 +-- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/configuration-properties/src/main/java/com/example/configprops/AppProperties.java b/configuration-properties/src/main/java/com/example/configprops/AppProperties.java index f6046635..8f0cc5b2 100644 --- a/configuration-properties/src/main/java/com/example/configprops/AppProperties.java +++ b/configuration-properties/src/main/java/com/example/configprops/AppProperties.java @@ -7,7 +7,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.util.unit.DataSize; @ConfigurationProperties(prefix = "app") -class AppProperties { +public class AppProperties { private String string; @@ -19,43 +19,43 @@ class AppProperties { private Nested nested = new Nested(); - List getStringList() { + public List getStringList() { return stringList; } - void setStringList(List stringList) { + public void setStringList(List stringList) { this.stringList = stringList; } - List getNestedList() { + public List getNestedList() { return nestedList; } - void setNestedList(List nestedList) { + public void setNestedList(List nestedList) { this.nestedList = nestedList; } - Nested getNested() { + public Nested getNested() { return nested; } - void setNested(Nested nested) { + public void setNested(Nested nested) { this.nested = nested; } - String getString() { + public String getString() { return string; } - void setString(String string) { + public void setString(String string) { this.string = string; } - DataSize getDataSize() { + public DataSize getDataSize() { return dataSize; } - void setDataSize(DataSize dataSize) { + public void setDataSize(DataSize dataSize) { this.dataSize = dataSize; } @@ -65,15 +65,15 @@ class AppProperties { + ", nestedList=" + nestedList + ", nested=" + nested + '}'; } - static class Nested { + public static class Nested { private int aInt; - int getaInt() { + public int getaInt() { return aInt; } - void setaInt(int aInt) { + public void setaInt(int aInt) { this.aInt = aInt; } diff --git a/configuration-properties/src/main/java/com/example/configprops/AppPropertiesCtor.java b/configuration-properties/src/main/java/com/example/configprops/AppPropertiesCtor.java index 656c552b..61e53175 100644 --- a/configuration-properties/src/main/java/com/example/configprops/AppPropertiesCtor.java +++ b/configuration-properties/src/main/java/com/example/configprops/AppPropertiesCtor.java @@ -6,7 +6,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.util.unit.DataSize; @ConfigurationProperties(prefix = "app.ctor") -class AppPropertiesCtor { +public class AppPropertiesCtor { private final String string; @@ -18,7 +18,7 @@ class AppPropertiesCtor { private final Nested nested; - AppPropertiesCtor(String string, DataSize dataSize, List stringList, List nestedList, + public AppPropertiesCtor(String string, DataSize dataSize, List stringList, List nestedList, Nested nested) { this.string = string; this.dataSize = dataSize; @@ -27,23 +27,23 @@ class AppPropertiesCtor { this.nested = nested; } - String getString() { + public String getString() { return string; } - DataSize getDataSize() { + public DataSize getDataSize() { return dataSize; } - List getStringList() { + public List getStringList() { return stringList; } - List getNestedList() { + public List getNestedList() { return nestedList; } - Nested getNested() { + public Nested getNested() { return nested; } @@ -53,15 +53,15 @@ class AppPropertiesCtor { + stringList + ", nestedList=" + nestedList + ", nested=" + nested + '}'; } - static class Nested { + public static class Nested { private final int aInt; - Nested(int aInt) { + public Nested(int aInt) { this.aInt = aInt; } - int getaInt() { + public int getaInt() { return aInt; } diff --git a/configuration-properties/src/main/java/com/example/configprops/AppPropertiesRecord.java b/configuration-properties/src/main/java/com/example/configprops/AppPropertiesRecord.java index 8f2384c3..73948015 100644 --- a/configuration-properties/src/main/java/com/example/configprops/AppPropertiesRecord.java +++ b/configuration-properties/src/main/java/com/example/configprops/AppPropertiesRecord.java @@ -6,8 +6,8 @@ import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.util.unit.DataSize; @ConfigurationProperties(prefix = "app.record") -record AppPropertiesRecord(String string, DataSize dataSize, List stringList, List nestedList, +public record AppPropertiesRecord(String string, DataSize dataSize, List stringList, List nestedList, Nested nested) { - record Nested(int aInt) { + public record Nested(int aInt) { } }