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 int
ERROR_MESSAGE
A message type that indicates that a message is an "error message".static int
INFO_MESSAGE
A message type that indicates that a message is an "informational message".static int
SUCCESS_MESSAGE
A message type that indicates that a message is a "success message".static int
WARNING_MESSAGE
A 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 boolean
equals(Object obj)
Indicates whether this Message is equal to the given object.Serializable[]
getArgs()
String
getMessage()
int
getType()
int
hashCode()
void
setArgs(Serializable... args)
Sets the message format arguments.void
setType(int type)
String
toString()
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, usingMessageFormat
syntax.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, usingMessageFormat
syntax.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.
-
-