Class ValidationErrors.Builder
java.lang.Object
com.inductiveautomation.ignition.gateway.config.ValidationErrors.Builder
- Enclosing class:
- ValidationErrors
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddFieldMessage
(String fieldName, String message) Adds a field-specific validation messageaddMessage
(String message) Adds an "overall" validation message that isn't field specificbuild()
Special version ofbuild()
that returns Optional.empty() if there are no messagesAdds an overall validation error message if the specified condition is false.checkField
(boolean condition, String fieldName, String message) Adds a field-specific validation message if the specified condition is false.checkFields
(boolean condition, String message, String... fieldNames) Adds a field-specific validation message which applies to multiple fields if the specified condition is false.requireNotBlank
(String fieldName, String value) Adds a field error message for the given field if the value is null or blank (as determined byString.isBlank()
)requireNotEmpty
(String fieldName, String value) Adds a field error message for the given field if the value is null or emptyrequireNotNull
(String fieldName, Object value) Adds a field error message for the given field if the value is null
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
addMessage
Adds an "overall" validation message that isn't field specific -
requireNotNull
Adds a field error message for the given field if the value is null -
requireNotEmpty
Adds a field error message for the given field if the value is null or empty -
requireNotBlank
Adds a field error message for the given field if the value is null or blank (as determined byString.isBlank()
) -
addFieldMessage
Adds a field-specific validation message -
check
Adds an overall validation error message if the specified condition is false. -
checkField
Adds a field-specific validation message if the specified condition is false. -
checkFields
public ValidationErrors.Builder checkFields(boolean condition, String message, String... fieldNames) Adds a field-specific validation message which applies to multiple fields if the specified condition is false. -
buildIfNotEmpty
Special version ofbuild()
that returns Optional.empty() if there are no messages -
build
-