775ac7b58c
you must login with an BTP account in order to see the app
31 lines
No EOL
577 B
JavaScript
31 lines
No EOL
577 B
JavaScript
class ValidationResults {
|
|
#state;
|
|
#description;
|
|
|
|
constructor(state, description) {
|
|
this.#state = state;
|
|
this.#description = description || "";
|
|
}
|
|
|
|
isValid() {
|
|
return this.#state;
|
|
}
|
|
|
|
isErroneous() {
|
|
return !this.isValid();
|
|
}
|
|
|
|
getErrorDescription() {
|
|
return this.#description;
|
|
}
|
|
|
|
static createValid() {
|
|
return new ValidationResults(true);
|
|
}
|
|
|
|
static createInvalid(description) {
|
|
return new ValidationResults(false, description)
|
|
}
|
|
};
|
|
|
|
module.exports = ValidationResults; |