Skip to content

Commit

Permalink
fix(Utils): Fixed Utils.Assertions.notEmpty
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeV220 committed Apr 10, 2022
1 parent 8f43dc0 commit e465113
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/main/java/com/georgev22/api/utilities/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -747,18 +747,16 @@ public static void notEmpty(Object object, String message) {
if (((Collection<?>) object).isEmpty()) {
throw new IllegalArgumentException(message);
}
}
if (object instanceof Map<?, ?>) {
} else if (object instanceof Map<?, ?>) {
if (((Map<?, ?>) object).isEmpty()) {
throw new IllegalArgumentException(message);
}
}
if (object instanceof String) {
} else if (object instanceof String) {
if (((String) object).isEmpty()) {
throw new IllegalArgumentException(message);
}
}
throw new IllegalArgumentException("Object must be a Collection, Map or String");
} else
throw new IllegalArgumentException("Object must be a Collection, Map or String");
}

private Assertions() {
Expand Down

0 comments on commit e465113

Please sign in to comment.