Class Message
- java.lang.Object
-
- com.github.bordertech.wcomponents.Message
-
- All Implemented Interfaces:
Serializable
public class Message extends Object implements Serializable
Message - encapsulates a simple message that is to be displayed to the user.- Since:
- 1.0.0
- Author:
- Yiannis Paschalidis
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intERROR_MESSAGEA message type that indicates that a message is an "error message".static intINFO_MESSAGEA message type that indicates that a message is an "informational message".static intSUCCESS_MESSAGEA message type that indicates that a message is a "success message".static intWARNING_MESSAGEA message type that indicates that a message is a "warning message".
-
Constructor Summary
Constructors Constructor Description Message(int type, String message, Serializable... args)Creates a message.Message(String message, Serializable... args)Creates an informational message.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Indicates whether this Message is equal to the given object.Serializable[]getArgs()StringgetMessage()intgetType()inthashCode()voidsetArgs(Serializable... args)Sets the message format arguments.voidsetType(int type)StringtoString()Returns a string representation of this Message.
-
-
-
Field Detail
-
INFO_MESSAGE
public static final int INFO_MESSAGE
A message type that indicates that a message is an "informational message".- See Also:
- Constant Field Values
-
WARNING_MESSAGE
public static final int WARNING_MESSAGE
A message type that indicates that a message is a "warning message".- See Also:
- Constant Field Values
-
ERROR_MESSAGE
public static final int ERROR_MESSAGE
A message type that indicates that a message is an "error message".- See Also:
- Constant Field Values
-
SUCCESS_MESSAGE
public static final int SUCCESS_MESSAGE
A message type that indicates that a message is a "success message".- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Message
public Message(String message, Serializable... args)
Creates an informational message.- Parameters:
message- the message text, usingMessageFormatsyntax.args- optional arguments for the message format string.
-
Message
public Message(int type, String message, Serializable... args)Creates a message.- Parameters:
type- the type of message.message- the message text, usingMessageFormatsyntax.args- optional arguments for the message format string.
-
-
Method Detail
-
getType
public int getType()
- Returns:
- Returns the type.
-
setArgs
public void setArgs(Serializable... args)
Sets the message format arguments.- Parameters:
args- the message arguments.
-
getArgs
public Serializable[] getArgs()
- Returns:
- Returns the message format arguments.
-
getMessage
public String getMessage()
- Returns:
- Returns the message.
-
setType
public final void setType(int type)
- Parameters:
type- The type to set.
-
toString
public String toString()
Returns a string representation of this Message.
-
equals
public boolean equals(Object obj)
Indicates whether this Message is equal to the given object.
-
-