Package org.opencms.gwt.shared
Class CmsValidationResult
- java.lang.Object
-
- org.opencms.gwt.shared.CmsValidationResult
-
- All Implemented Interfaces:
com.google.gwt.user.client.rpc.IsSerializable
public class CmsValidationResult extends java.lang.Object implements com.google.gwt.user.client.rpc.IsSerializable
The result of a single field validation.- Since:
- 8.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static CmsValidationResult
VALIDATION_OK
Convenience constant which contains a validation result for successful validations.
-
Constructor Summary
Constructors Modifier Constructor Description protected
CmsValidationResult()
Hidden default constructor.CmsValidationResult(java.lang.String errorMessage)
Creates a new validation result which doesn't replace the current field value.CmsValidationResult(java.lang.String errorMessage, java.lang.String newValue)
Creates a new validation result which also replaces the current field value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getErrorMessage()
Returns the error message, or null if the validation has succeeded.java.lang.String
getNewValue()
Returns the replacement for the field value.boolean
hasNewValue()
Returns true if the field value should be replaced.boolean
isOk()
Returns true if the validation has succeeded.
-
-
-
Field Detail
-
VALIDATION_OK
public static final CmsValidationResult VALIDATION_OK
Convenience constant which contains a validation result for successful validations.
-
-
Constructor Detail
-
CmsValidationResult
public CmsValidationResult(java.lang.String errorMessage)
Creates a new validation result which doesn't replace the current field value.- Parameters:
errorMessage
- the error message to display, or null if there
-
CmsValidationResult
public CmsValidationResult(java.lang.String errorMessage, java.lang.String newValue)
Creates a new validation result which also replaces the current field value.- Parameters:
errorMessage
- the error message to display, or null if there was no errornewValue
- the replacement for the field value
-
CmsValidationResult
protected CmsValidationResult()
Hidden default constructor.
-
-
Method Detail
-
getErrorMessage
public java.lang.String getErrorMessage()
Returns the error message, or null if the validation has succeeded.- Returns:
- an error message or null the
-
getNewValue
public java.lang.String getNewValue()
Returns the replacement for the field value.- Returns:
- the replacement for the field value
-
hasNewValue
public boolean hasNewValue()
Returns true if the field value should be replaced.- Returns:
- true if the field value should be replaced
-
isOk
public boolean isOk()
Returns true if the validation has succeeded.- Returns:
- true if the validation has succeeded
-
-