Skip to content

Instantly share code, notes, and snippets.

@douglas444
Created November 14, 2025 21:28
Show Gist options
  • Select an option

  • Save douglas444/595a6da87cd47b0d1c27d620fdaca2b2 to your computer and use it in GitHub Desktop.

Select an option

Save douglas444/595a6da87cd47b0d1c27d620fdaca2b2 to your computer and use it in GitHub Desktop.
public class Assert {
private Assert() {
}
public static void required(Object... objects) {
for (int i = 0, objectsLength = objects.length; i < objectsLength; i++) {
if (objects[i] == null || (objects[i] instanceof String && ((String) objects[i]).isBlank())) {
throw new DomainException("Parameter " + i + " is required");
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment