diff --git a/guest/core-java/pom.xml b/guest/core-java/pom.xml index c3042ca94aaa..b3c6ba956433 100644 --- a/guest/core-java/pom.xml +++ b/guest/core-java/pom.xml @@ -41,11 +41,18 @@ ${org.hamcrest.version} test + + org.assertj + assertj-core + ${assertj.version} + test + 2.8.2 1.3 + 3.6.1 \ No newline at end of file diff --git a/core-java/src/main/java/com/baeldung/optionalparams/MultiVitamin.java b/guest/core-java/src/main/java/com/stackify/optionalparams/MultiVitamin.java similarity index 91% rename from core-java/src/main/java/com/baeldung/optionalparams/MultiVitamin.java rename to guest/core-java/src/main/java/com/stackify/optionalparams/MultiVitamin.java index 709e74eac075..90cb49b32142 100644 --- a/core-java/src/main/java/com/baeldung/optionalparams/MultiVitamin.java +++ b/guest/core-java/src/main/java/com/stackify/optionalparams/MultiVitamin.java @@ -1,50 +1,50 @@ -package com.baeldung.optionalparams; - -public class MultiVitamin { - - private String name; // required - private int vitaminA; // in mcg - private int vitaminC; // in mg - private int calcium; // in mg - private int iron; // in mg - - public MultiVitamin(String name) { - this.name = name; - } - - public String getName() { - return name; - } - - public int getVitaminA() { - return vitaminA; - } - - public void setVitaminA(int vitaminA) { - this.vitaminA = vitaminA; - } - - public int getVitaminC() { - return vitaminC; - } - - public void setVitaminC(int vitaminC) { - this.vitaminC = vitaminC; - } - - public int getCalcium() { - return calcium; - } - - public void setCalcium(int calcium) { - this.calcium = calcium; - } - - public int getIron() { - return iron; - } - - public void setIron(int iron) { - this.iron = iron; - } +package com.stackify.optionalparams; + +public class MultiVitamin { + + private String name; // required + private int vitaminA; // in mcg + private int vitaminC; // in mg + private int calcium; // in mg + private int iron; // in mg + + public MultiVitamin(String name) { + this.name = name; + } + + public String getName() { + return name; + } + + public int getVitaminA() { + return vitaminA; + } + + public void setVitaminA(int vitaminA) { + this.vitaminA = vitaminA; + } + + public int getVitaminC() { + return vitaminC; + } + + public void setVitaminC(int vitaminC) { + this.vitaminC = vitaminC; + } + + public int getCalcium() { + return calcium; + } + + public void setCalcium(int calcium) { + this.calcium = calcium; + } + + public int getIron() { + return iron; + } + + public void setIron(int iron) { + this.iron = iron; + } } \ No newline at end of file diff --git a/core-java/src/main/java/com/baeldung/optionalparams/MultiVitaminAllowingNulls.java b/guest/core-java/src/main/java/com/stackify/optionalparams/MultiVitaminAllowingNulls.java similarity index 95% rename from core-java/src/main/java/com/baeldung/optionalparams/MultiVitaminAllowingNulls.java rename to guest/core-java/src/main/java/com/stackify/optionalparams/MultiVitaminAllowingNulls.java index 36d178783a8a..1d2a61354d88 100644 --- a/core-java/src/main/java/com/baeldung/optionalparams/MultiVitaminAllowingNulls.java +++ b/guest/core-java/src/main/java/com/stackify/optionalparams/MultiVitaminAllowingNulls.java @@ -1,4 +1,4 @@ -package com.baeldung.optionalparams; +package com.stackify.optionalparams; public class MultiVitaminAllowingNulls { diff --git a/core-java/src/main/java/com/baeldung/optionalparams/MultiVitaminOverloading.java b/guest/core-java/src/main/java/com/stackify/optionalparams/MultiVitaminOverloading.java similarity index 93% rename from core-java/src/main/java/com/baeldung/optionalparams/MultiVitaminOverloading.java rename to guest/core-java/src/main/java/com/stackify/optionalparams/MultiVitaminOverloading.java index e1d3032fd3c2..e9dcb2509b85 100644 --- a/core-java/src/main/java/com/baeldung/optionalparams/MultiVitaminOverloading.java +++ b/guest/core-java/src/main/java/com/stackify/optionalparams/MultiVitaminOverloading.java @@ -1,56 +1,56 @@ -package com.baeldung.optionalparams; - -public class MultiVitaminOverloading { - - static final int DEFAULT_IRON_AMOUNT = 20; - - private final String name; // required - private final int vitaminA; // in mcg - private final int vitaminC; // in mg - private final int calcium; // in mg - private final int iron; // in mg - - public MultiVitaminOverloading(String name) { - this(name, 0); - } - - public MultiVitaminOverloading(String name, int vitaminA) { - this(name, vitaminA, 0); - } - - public MultiVitaminOverloading(String name, int vitaminA, int vitaminC) { - this(name, vitaminA, vitaminC, 0); - } - - public MultiVitaminOverloading(String name, int vitaminA, int vitaminC, int calcium) { - this(name, vitaminA, vitaminC, calcium, DEFAULT_IRON_AMOUNT); - } - - public MultiVitaminOverloading(String name, int vitaminA, int vitaminC, int calcium, int iron) { - this.name = name; - this.vitaminA = vitaminA; - this.vitaminC = vitaminC; - this.calcium = calcium; - this.iron = iron; - } - - public String getName() { - return name; - } - - public int getVitaminA() { - return vitaminA; - } - - public int getVitaminC() { - return vitaminC; - } - - public int getCalcium() { - return calcium; - } - - public int getIron() { - return iron; - } +package com.stackify.optionalparams; + +public class MultiVitaminOverloading { + + static final int DEFAULT_IRON_AMOUNT = 20; + + private final String name; // required + private final int vitaminA; // in mcg + private final int vitaminC; // in mg + private final int calcium; // in mg + private final int iron; // in mg + + public MultiVitaminOverloading(String name) { + this(name, 0); + } + + public MultiVitaminOverloading(String name, int vitaminA) { + this(name, vitaminA, 0); + } + + public MultiVitaminOverloading(String name, int vitaminA, int vitaminC) { + this(name, vitaminA, vitaminC, 0); + } + + public MultiVitaminOverloading(String name, int vitaminA, int vitaminC, int calcium) { + this(name, vitaminA, vitaminC, calcium, DEFAULT_IRON_AMOUNT); + } + + public MultiVitaminOverloading(String name, int vitaminA, int vitaminC, int calcium, int iron) { + this.name = name; + this.vitaminA = vitaminA; + this.vitaminC = vitaminC; + this.calcium = calcium; + this.iron = iron; + } + + public String getName() { + return name; + } + + public int getVitaminA() { + return vitaminA; + } + + public int getVitaminC() { + return vitaminC; + } + + public int getCalcium() { + return calcium; + } + + public int getIron() { + return iron; + } } \ No newline at end of file diff --git a/core-java/src/main/java/com/baeldung/optionalparams/MultiVitaminStaticFactoryMethods.java b/guest/core-java/src/main/java/com/stackify/optionalparams/MultiVitaminStaticFactoryMethods.java similarity index 97% rename from core-java/src/main/java/com/baeldung/optionalparams/MultiVitaminStaticFactoryMethods.java rename to guest/core-java/src/main/java/com/stackify/optionalparams/MultiVitaminStaticFactoryMethods.java index ca7ab0f6cf19..229a2f000425 100644 --- a/core-java/src/main/java/com/baeldung/optionalparams/MultiVitaminStaticFactoryMethods.java +++ b/guest/core-java/src/main/java/com/stackify/optionalparams/MultiVitaminStaticFactoryMethods.java @@ -1,4 +1,4 @@ -package com.baeldung.optionalparams; +package com.stackify.optionalparams; public class MultiVitaminStaticFactoryMethods { diff --git a/core-java/src/main/java/com/baeldung/optionalparams/MultiVitaminWithBuilder.java b/guest/core-java/src/main/java/com/stackify/optionalparams/MultiVitaminWithBuilder.java similarity index 94% rename from core-java/src/main/java/com/baeldung/optionalparams/MultiVitaminWithBuilder.java rename to guest/core-java/src/main/java/com/stackify/optionalparams/MultiVitaminWithBuilder.java index e1b2920e9ae9..8097074b8697 100644 --- a/core-java/src/main/java/com/baeldung/optionalparams/MultiVitaminWithBuilder.java +++ b/guest/core-java/src/main/java/com/stackify/optionalparams/MultiVitaminWithBuilder.java @@ -1,77 +1,77 @@ -package com.baeldung.optionalparams; - -public class MultiVitaminWithBuilder { - - private final String name; // required - private final int vitaminA; // in mcg - private final int vitaminC; // in mg - private final int calcium; // in mg - private final int iron; // in mg - - private MultiVitaminWithBuilder(MultiVitaminBuilder builder) { - this.name = builder.name; - this.vitaminA = builder.vitaminA; - this.vitaminC = builder.vitaminC; - this.calcium = builder.calcium; - this.iron = builder.iron; - } - - public String getName() { - return name; - } - - public int getVitaminA() { - return vitaminA; - } - - public int getVitaminC() { - return vitaminC; - } - - public int getCalcium() { - return calcium; - } - - public int getIron() { - return iron; - } - - public static class MultiVitaminBuilder { - - private static final int ZERO = 0; - - private final String name; // required - private int vitaminA = ZERO; - private int vitaminC = ZERO; - private int calcium = ZERO; - private int iron = ZERO; - - public MultiVitaminBuilder(String name) { - this.name = name; - } - - public MultiVitaminBuilder withVitaminA(int vitaminA) { - this.vitaminA = vitaminA; - return this; - } - - public MultiVitaminBuilder withVitaminC(int vitaminC) { - this.vitaminC = vitaminC; - return this; - } - - public MultiVitaminBuilder withCalcium(int calcium) { - this.calcium = calcium; - return this; - } - - public MultiVitaminBuilder withIron(int iron) { - this.iron = iron; - return this; - } - - public MultiVitaminWithBuilder build() { - return new MultiVitaminWithBuilder(this); - } - } -} +package com.stackify.optionalparams; + +public class MultiVitaminWithBuilder { + + private final String name; // required + private final int vitaminA; // in mcg + private final int vitaminC; // in mg + private final int calcium; // in mg + private final int iron; // in mg + + private MultiVitaminWithBuilder(MultiVitaminBuilder builder) { + this.name = builder.name; + this.vitaminA = builder.vitaminA; + this.vitaminC = builder.vitaminC; + this.calcium = builder.calcium; + this.iron = builder.iron; + } + + public String getName() { + return name; + } + + public int getVitaminA() { + return vitaminA; + } + + public int getVitaminC() { + return vitaminC; + } + + public int getCalcium() { + return calcium; + } + + public int getIron() { + return iron; + } + + public static class MultiVitaminBuilder { + + private static final int ZERO = 0; + + private final String name; // required + private int vitaminA = ZERO; + private int vitaminC = ZERO; + private int calcium = ZERO; + private int iron = ZERO; + + public MultiVitaminBuilder(String name) { + this.name = name; + } + + public MultiVitaminBuilder withVitaminA(int vitaminA) { + this.vitaminA = vitaminA; + return this; + } + + public MultiVitaminBuilder withVitaminC(int vitaminC) { + this.vitaminC = vitaminC; + return this; + } + + public MultiVitaminBuilder withCalcium(int calcium) { + this.calcium = calcium; + return this; + } + + public MultiVitaminBuilder withIron(int iron) { + this.iron = iron; + return this; + } + + public MultiVitaminWithBuilder build() { + return new MultiVitaminWithBuilder(this); + } + } +} diff --git a/core-java/src/test/java/com/baeldung/optionalparams/OptionalParamsUnitTest.java b/guest/core-java/src/test/java/com/stackify/optionalparams/OptionalParamsUnitTest.java similarity index 99% rename from core-java/src/test/java/com/baeldung/optionalparams/OptionalParamsUnitTest.java rename to guest/core-java/src/test/java/com/stackify/optionalparams/OptionalParamsUnitTest.java index 4f3c31822b46..947ce83a9025 100644 --- a/core-java/src/test/java/com/baeldung/optionalparams/OptionalParamsUnitTest.java +++ b/guest/core-java/src/test/java/com/stackify/optionalparams/OptionalParamsUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.optionalparams; +package com.stackify.optionalparams; import static org.assertj.core.api.Assertions.assertThat;