com.atlassian.jira.issue.fields.util
Class MessagedResult

java.lang.Object
  extended by com.atlassian.jira.issue.fields.util.MessagedResult

public class MessagedResult
extends Object

This class wraps a boolean result and allows the result creator to specify a string message about the result and allows a false result to be classified as Normal, a Warning, or a Fatal error.


Field Summary
static int FATAL
           
static int NORMAL
           
static int WARNING
           
 
Constructor Summary
MessagedResult(boolean result)
          Constructs a message result with a null message whose state is normal.
MessagedResult(boolean result, String message)
          Constructs a message result whose state is normal
MessagedResult(boolean result, String message, int state)
          Used to construct a messaged result.
MessagedResult(String html, int state)
          Use this to specify the state of the html message.
 
Method Summary
 String getMessage()
           
 boolean getResult()
           
 boolean isFatal()
           
 boolean isWarning()
           
 void setMessage(String message)
           
 void setResult(boolean result)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NORMAL

public static final int NORMAL
See Also:
Constant Field Values

WARNING

public static final int WARNING
See Also:
Constant Field Values

FATAL

public static final int FATAL
See Also:
Constant Field Values
Constructor Detail

MessagedResult

public MessagedResult(boolean result)
Constructs a message result with a null message whose state is normal.

Parameters:
result - was the result of the operation

MessagedResult

public MessagedResult(boolean result,
                      String message)
Constructs a message result whose state is normal

Parameters:
result - was the result of the operation
message - the message about the state and the result

MessagedResult

public MessagedResult(boolean result,
                      String message,
                      int state)
Used to construct a messaged result.

Parameters:
result - was the result of the operation
message - the message about the state and the result
state - can be NORMAL, WARNING or FATAL if result is false, otherwise this is ignored

MessagedResult

public MessagedResult(String html,
                      int state)
Use this to specify the state of the html message. Error indicates that the operation can not proceed, Warning inidicates that the message will be displayed to the user but that the operation can proceed, and Normal means that everything is ok.

Parameters:
html -
state - the state of the display html.
Method Detail

getResult

public boolean getResult()

setResult

public void setResult(boolean result)

getMessage

public String getMessage()

setMessage

public void setMessage(String message)

isFatal

public boolean isFatal()

isWarning

public boolean isWarning()


Copyright © 2002-2014 Atlassian. All Rights Reserved.