Skip to content
Snippets Groups Projects
Commit 06db4bbb authored by Colin DAMON's avatar Colin DAMON
Browse files

Declare Calculator as a static class

parent f3728963
No related branches found
No related tags found
1 merge request!12Resolve "Mutualise java build"
......@@ -3,7 +3,10 @@ package fr.ippon.stringcalculator;
import java.math.BigDecimal;
import java.util.function.BinaryOperator;
public class Calculator {
public final class Calculator {
private Calculator() {
}
public static String sum(String first, String second) {
return operate(first, second, BigDecimal::add);
......@@ -14,8 +17,8 @@ public class Calculator {
return operate(first, second, BigDecimal::subtract);
}
private static String operate(String first,
String second, BinaryOperator<BigDecimal> operation) {
private static String operate(String first, String second,
BinaryOperator<BigDecimal> operation) {
notNull(first);
notNull(second);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment