diff options
author | Harald Musum <musum@yahooinc.com> | 2023-10-31 14:57:05 +0100 |
---|---|---|
committer | Harald Musum <musum@yahooinc.com> | 2023-10-31 14:57:05 +0100 |
commit | 6572324794d105fcf24b5d98f7405b2aea48de0b (patch) | |
tree | e2b5db8f411363213ae2688292fd0da1fd790088 /config-model-api | |
parent | a06b9c56ec1d65e951b94473c49e746c736dc19c (diff) |
Minor cleanup
Diffstat (limited to 'config-model-api')
-rw-r--r-- | config-model-api/src/main/java/com/yahoo/config/model/api/Quota.java | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/config-model-api/src/main/java/com/yahoo/config/model/api/Quota.java b/config-model-api/src/main/java/com/yahoo/config/model/api/Quota.java index b652f9e8a68..f49bb224394 100644 --- a/config-model-api/src/main/java/com/yahoo/config/model/api/Quota.java +++ b/config-model-api/src/main/java/com/yahoo/config/model/api/Quota.java @@ -25,12 +25,7 @@ public class Quota { /** The max budget in dollars per hour */ private final Optional<BigDecimal> budget; - public Quota(Optional<Integer> maxClusterSize, Optional<Integer> budget) { - this(maxClusterSize, budget.map(BigDecimal::new), true); - } - - // TODO: Remove unused argument - private Quota(Optional<Integer> maxClusterSize, Optional<BigDecimal> budget, boolean isDecimal) { + public Quota(Optional<Integer> maxClusterSize, Optional<BigDecimal> budget) { this.maxClusterSize = Objects.requireNonNull(maxClusterSize); this.budget = Objects.requireNonNull(budget); } @@ -38,15 +33,15 @@ public class Quota { public static Quota fromSlime(Inspector inspector) { var clusterSize = SlimeUtils.optionalInteger(inspector.field("clusterSize")); var budget = budgetFromSlime(inspector.field("budget")); - return new Quota(clusterSize.stream().boxed().findFirst(), budget, true); + return new Quota(clusterSize.stream().boxed().findFirst(), budget); } public Quota withBudget(BigDecimal budget) { - return new Quota(this.maxClusterSize, Optional.of(budget), true); + return new Quota(this.maxClusterSize, Optional.of(budget)); } public Quota withClusterSize(int clusterSize) { - return new Quota(Optional.of(clusterSize), this.budget, true); + return new Quota(Optional.of(clusterSize), this.budget); } public Slime toSlime() { |