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()StringgetDefaultMessage()static SpringMessageof(String codes)returns aMessagewith message codesstatic SpringMessageof(String[] codes)returns aMessagewith message codesstatic SpringMessageof(String[] codes, Object... arguments)returns aMessagewith message codes,arguments, and default messagestatic SpringMessageof(String codes, Object... arguments)returns aMessagewith message codes and argumentsSpringMessageorElse(String defaultMessage)returnsMessagewith a default message
-
-
-
Method Detail
-
of
public static SpringMessage of(String[] codes, Object... arguments)
returns aMessagewith 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 aMessagewith 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 aMessagewith message codes- Parameters:
codes- codes to be used to resolve this message
-
of
public static SpringMessage of(String codes, Object... arguments)
returns aMessagewith 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)
returnsMessagewith a default message- Parameters:
defaultMessage- default message to be use to resolve this message.
-
getCodes
public String[] getCodes()
- Specified by:
getCodesin interfaceMessageSourceResolvable
-
getArguments
public Object[] getArguments()
- Specified by:
getArgumentsin interfaceMessageSourceResolvable
-
getDefaultMessage
public String getDefaultMessage()
- Specified by:
getDefaultMessagein interfaceMessageSourceResolvable
-
-