Implement Trader V4 training artifact pipeline
This commit is contained in:
@@ -3,7 +3,6 @@ package com.quantai.trader.util;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.MathContext;
|
||||
import java.util.Collection;
|
||||
import java.util.Objects;
|
||||
|
||||
public final class TraderNumbers {
|
||||
public static final BigDecimal ZERO = BigDecimal.ZERO;
|
||||
@@ -14,7 +13,10 @@ public final class TraderNumbers {
|
||||
}
|
||||
|
||||
public static BigDecimal required(BigDecimal value, String field) {
|
||||
return Objects.requireNonNull(value, field + " is required");
|
||||
if (value == null) {
|
||||
throw new IllegalArgumentException(field + " is required");
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
public static String requiredText(String value, String field) {
|
||||
@@ -68,6 +70,9 @@ public final class TraderNumbers {
|
||||
}
|
||||
|
||||
public static <T> Collection<T> requiredCollection(Collection<T> value, String field) {
|
||||
return Objects.requireNonNull(value, field + " is required");
|
||||
if (value == null) {
|
||||
throw new IllegalArgumentException(field + " is required");
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user