Package io.toro.martini.util
Class SpringMessage
- java.lang.Object
-
- io.toro.martini.util.SpringMessage
-
- All Implemented Interfaces:
MessageSourceResolvable
public final class SpringMessage extends Object implements MessageSourceResolvable
Message object designed for Spring message tags.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Object[]
getArguments()
String[]
getCodes()
String
getDefaultMessage()
static SpringMessage
of(String codes)
returns aMessage
with message codesstatic SpringMessage
of(String[] codes)
returns aMessage
with message codesstatic SpringMessage
of(String[] codes, Object... arguments)
returns aMessage
with message codes,arguments, and default messagestatic SpringMessage
of(String codes, Object... arguments)
returns aMessage
with message codes and argumentsSpringMessage
orElse(String defaultMessage)
returnsMessage
with a default message
-
-
-
Method Detail
-
of
public static SpringMessage of(String[] codes, Object... arguments)
returns aMessage
with message codes,arguments, and default message- Parameters:
codes
- codes to be used to resolve this message, in the order that they should get tried. The last code will therefore be the default one.arguments
- array of arguments to be used to resolve this message.
-
of
public static SpringMessage of(String[] codes)
returns aMessage
with message codes- Parameters:
codes
- codes to be used to resolve this message, in the order that they should get tried. The last code will therefore be the default one.
-
of
public static SpringMessage of(String codes)
returns aMessage
with message codes- Parameters:
codes
- codes to be used to resolve this message
-
of
public static SpringMessage of(String codes, Object... arguments)
returns aMessage
with message codes and arguments- Parameters:
codes
- codes to be used to resolve this message, in the order that they should get tried. The last code will therefore be the default one.arguments
- array of arguments to be used to resolve this message.
-
orElse
public SpringMessage orElse(String defaultMessage)
returnsMessage
with a default message- Parameters:
defaultMessage
- default message to be use to resolve this message.
-
getCodes
public String[] getCodes()
- Specified by:
getCodes
in interfaceMessageSourceResolvable
-
getArguments
public Object[] getArguments()
- Specified by:
getArguments
in interfaceMessageSourceResolvable
-
getDefaultMessage
public String getDefaultMessage()
- Specified by:
getDefaultMessage
in interfaceMessageSourceResolvable
-
-