justinmclean commented on code in PR #6109:
URL: https://github.com/apache/gravitino/pull/6109#discussion_r1903787701
##########
clients/cli/src/main/java/org/apache/gravitino/cli/commands/Command.java:
##########
@@ -112,15 +112,28 @@ public Command validate() {
}
/**
- * Validates that both property and value parameters are not null.
+ * Validates that both property and value arguments are not null.
*
* @param property The property name to check
* @param value The value associated with the property
*/
- protected void checkProperty(String property, String value) {
+ protected void validatePropertyAndValue(String property, String value) {
if (property == null && value == null)
exitWithError(ErrorMessages.MISSING_PROPERTY_AND_VALUE);
- if (property == null) exitWithError(ErrorMessages.MISSING_PROPERTY);
- if (value == null) exitWithError(ErrorMessages.MISSING_VALUE);
+ validateString(property, ErrorMessages.MISSING_PROPERTY);
+ validateString(value, ErrorMessages.MISSING_VALUE);
+ }
+
+ /**
+ * Validates that the property argument is not null.
+ *
+ * @param property The property name to validate
+ */
+ protected void validateProperty(String property) {
+ validateString(property, ErrorMessages.MISSING_PROPERTY);
+ }
+
+ private void validateString(String s, String message) {
Review Comment:
notNullString would be a better name I think, but we probably don't need
this method and just have the check in validateProperty
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]