Package eu.bandm.tools.annotations
Class SimplePreMessage
java.lang.Object
eu.bandm.tools.annotations.SimplePreMessage
- All Implemented Interfaces:
PreMessage
Most simple implementation of a
PreMessage
.- Since:
- 1.3
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionObject[]
getArgs()
Returns a copy of the arguments.getText()
Returns the template text.static PreMessage
preMessage
(String text, Object... args) Factory method.toString()
Returns a string representation of this object.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface eu.bandm.tools.annotations.PreMessage
format
-
Field Details
-
text
The template text of the message. -
args
The arguments of the message.
-
-
Constructor Details
-
SimplePreMessage
Constructs a new instance.- Parameters:
text
- the template textargs
- the arguments for formatting- Throws:
NullPointerException
- iftext
orargs
are null.
-
-
Method Details
-
getArgs
Returns a copy of the arguments.- Specified by:
getArgs
in interfacePreMessage
- Returns:
- a copy of the arguments.
-
getText
Returns the template text.- Specified by:
getText
in interfacePreMessage
- Returns:
- the template text.
-
toString
Returns a string representation of this object.This implementation shows the template text and the arguments unformatted.
-
preMessage
Factory method.- Parameters:
text
- the template textargs
- the arguments for formatting- Returns:
- an new instace
-