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 PreMessagepreMessage(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, waitMethods 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- iftextorargsare null.
-
-
Method Details
-
getArgs
Returns a copy of the arguments.- Specified by:
getArgsin interfacePreMessage- Returns:
- a copy of the arguments.
-
getText
Returns the template text.- Specified by:
getTextin 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
-