Skip to content

Commit

Permalink
fix: getMetaByMap logic
Browse files Browse the repository at this point in the history
  • Loading branch information
JustKode committed Aug 4, 2023
1 parent 29532e6 commit 892b5c2
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static DoubleMeta getMetaByMap(String key, Map<String, Object> map) {
Double minValue = (Double) map.get("min_value");
Double maxValue = (Double) map.get("max_value");

if (isManual && manualValues != null) {
if (isManual && manualValues == null) {
throw new RuntimeException("manual_integers doesn't exists.");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static FloatMeta getMetaByMap(String key, Map<String, Object> map) {
Float minValue = (Float) map.get("min_value");
Float maxValue = (Float) map.get("max_value");

if (isManual && manualValues != null) {
if (isManual && manualValues == null) {
throw new RuntimeException("manual_integers doesn't exists.");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ public static IntegerMeta getMetaByMap(String key, Map<String, Object> map) {
Integer minValue = (Integer) map.get("min_value");
Integer maxValue = (Integer) map.get("max_value");

if (isManual && manualValues != null) {
throw new RuntimeException("manual_integers doesn't exists.");
if (isManual && manualValues == null) {
throw new RuntimeException("manual_values doesn't exists.");
}
IntegerMeta integerMeta = new IntegerMeta(isManual, manualValues, minValue, maxValue);
integerMeta.validCheck(key);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static LongMeta getMetaByMap(String key, Map<String, Object> map) {
Long minValue = (Long) map.get("min_value");
Long maxValue = (Long) map.get("max_value");

if (isManual && manualValues != null) {
if (isManual && manualValues == null) {
throw new RuntimeException("manual_integers doesn't exists.");
}
LongMeta longMeta = new LongMeta(isManual, manualValues, minValue, maxValue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static StringMeta getMetaByMap(String key, Map<String, Object> map) {
Integer minLength = (Integer) map.get("min_length");
Integer maxLength = (Integer) map.get("max_length");

if (isManual && manualValues != null) {
if (isManual && manualValues == null) {
throw new RuntimeException("manual_integers doesn't exists.");
}
StringMeta stringMeta = new StringMeta(isManual, manualValues, minLength, maxLength);
Expand Down

0 comments on commit 892b5c2

Please sign in to comment.