public final class

Failure

extends Object
implements Validator.Result
java.lang.Object
   ↳ com.atlassian.validation.Failure

Class Overview

A Validator.Result that represents epic validation failure.

Summary

Public Constructors
Failure(String message)
Creates failure from a given text message, encoding the text message as a whole into html for the html message.
Failure(String textError, String htmlError)
Creates failure from a text message and an html equivalent message.
Public Methods
String get()
If valid returns the value in string form.
String getErrorMessage()
If validation failed, the reason is found here in plain text.
String getErrorMessageHtml()
If validation failed, the reason is found here in html.
boolean isValid()
Whether the validation succeeded.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.validation.Validator.Result

Public Constructors

public Failure (String message)

Creates failure from a given text message, encoding the text message as a whole into html for the html message.

Parameters
message the failure message in text.

public Failure (String textError, String htmlError)

Creates failure from a text message and an html equivalent message.

Parameters
textError the error to be displayed in plain text output (such as logs).
htmlError the error to be displayed in a browser or html email.

Public Methods

public String get ()

If valid returns the value in string form.

Returns
  • the value.

public String getErrorMessage ()

If validation failed, the reason is found here in plain text.

Returns
  • the error message if any, or null if validation succeeded.

public String getErrorMessageHtml ()

If validation failed, the reason is found here in html.

Returns
  • the error message if any, or null if validation succeeded.

public boolean isValid ()

Whether the validation succeeded.

Returns
  • true only if validaiton was successful.