mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-14 22:58:36 +00:00
* Issue #2377: The repository code has been refactored to use the record class * Issue #2377: Refactored according to the rules defined for the repo code * Issue #2377: Refactored according to the rules defined for the repo code * Issue #2377: Refactored according to the rules defined for the repo code
This commit is contained in:
@@ -27,36 +27,6 @@ package com.iluwatar.privateclassdata;
|
||||
/**
|
||||
* Stew ingredients.
|
||||
*/
|
||||
public class StewData {
|
||||
|
||||
private final int numPotatoes;
|
||||
private final int numCarrots;
|
||||
private final int numMeat;
|
||||
private final int numPeppers;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public StewData(int numPotatoes, int numCarrots, int numMeat, int numPeppers) {
|
||||
this.numPotatoes = numPotatoes;
|
||||
this.numCarrots = numCarrots;
|
||||
this.numMeat = numMeat;
|
||||
this.numPeppers = numPeppers;
|
||||
}
|
||||
|
||||
public int getNumPotatoes() {
|
||||
return numPotatoes;
|
||||
}
|
||||
|
||||
public int getNumCarrots() {
|
||||
return numCarrots;
|
||||
}
|
||||
|
||||
public int getNumMeat() {
|
||||
return numMeat;
|
||||
}
|
||||
|
||||
public int getNumPeppers() {
|
||||
return numPeppers;
|
||||
}
|
||||
public record StewData(int numPotatoes, int numCarrots, int numMeat, int numPeppers) {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user