public class ValidationResult extends Object
| Constructor and Description |
|---|
ValidationResult(boolean valid)
Creates an instance of a validation result that indicate a valid/invalid state without
an error message
|
ValidationResult(boolean valid,
String errorMessage)
Creates an instance of a validation result that indicate a valid/invalid state with an
error message
|
| Modifier and Type | Method and Description |
|---|---|
String |
getErrorMessage() |
static ValidationResult |
invalid(String errorMessage)
Creates an instance of a validation result that indicate an invalid state with an error
message
|
boolean |
isValid() |
static ValidationResult |
valid()
Creates an instance of a validation result that indicate a valid state
|
public ValidationResult(boolean valid)
valid - boolean, if true the state is valid otherwise invalidpublic ValidationResult(boolean valid,
String errorMessage)
valid - boolean, if true the state is valid otherwise invaliderrorMessage - String error messagepublic static ValidationResult valid()
public static ValidationResult invalid(String errorMessage)
errorMessage - String error messagepublic String getErrorMessage()
public boolean isValid()
Copyright © 2019–2022 Dominokit. All rights reserved.