forked from eugenp/tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BAEL-1706 move code to guest module (eugenp#4123)
- Loading branch information
1 parent
9b44056
commit 12cdd53
Showing
7 changed files
with
191 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 49 additions & 49 deletions
98
...baeldung/optionalparams/MultiVitamin.java → ...stackify/optionalparams/MultiVitamin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...onalparams/MultiVitaminAllowingNulls.java → ...onalparams/MultiVitaminAllowingNulls.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
110 changes: 55 additions & 55 deletions
110
...tionalparams/MultiVitaminOverloading.java → ...tionalparams/MultiVitaminOverloading.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...ams/MultiVitaminStaticFactoryMethods.java → ...ams/MultiVitaminStaticFactoryMethods.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.