Skip to content

Commit

Permalink
BAEL-1706 move code to guest module (eugenp#4123)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisoberle authored and Eugen committed Apr 28, 2018
1 parent 9b44056 commit 12cdd53
Show file tree
Hide file tree
Showing 7 changed files with 191 additions and 184 deletions.
7 changes: 7 additions & 0 deletions guest/core-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,18 @@
<version>${org.hamcrest.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<properties>
<log4j2.version>2.8.2</log4j2.version>
<org.hamcrest.version>1.3</org.hamcrest.version>
<assertj.version>3.6.1</assertj.version>
</properties>

</project>
Original file line number Diff line number Diff line change
@@ -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;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.baeldung.optionalparams;
package com.stackify.optionalparams;

public class MultiVitaminAllowingNulls {

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.baeldung.optionalparams;
package com.stackify.optionalparams;

public class MultiVitaminStaticFactoryMethods {

Expand Down
Loading

0 comments on commit 12cdd53

Please sign in to comment.