public final class SpringMessage extends Object implements MessageSourceResolvable
Modifier and Type | Method and Description |
---|---|
Object[] |
getArguments() |
String[] |
getCodes() |
String |
getDefaultMessage() |
static SpringMessage |
of(String codes)
returns a
Message with message codes |
static SpringMessage |
of(String[] codes)
returns a
Message with message codes |
static SpringMessage |
of(String[] codes,
Object... arguments)
returns a
Message with message codes,arguments, and default message |
static SpringMessage |
of(String codes,
Object... arguments)
returns a
Message with message codes and arguments |
SpringMessage |
orElse(String defaultMessage)
returns
Message with a default message |
public static SpringMessage of(String[] codes, Object... arguments)
Message
with message codes,arguments, and default messagecodes
- 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.public static SpringMessage of(String[] codes)
Message
with message codescodes
- 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.public static SpringMessage of(String codes)
Message
with message codescodes
- codes to be used to resolve this messagepublic static SpringMessage of(String codes, Object... arguments)
Message
with message codes and argumentscodes
- 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.public SpringMessage orElse(String defaultMessage)
Message
with a default messagedefaultMessage
- default message to be use to resolve this message.public String[] getCodes()
getCodes
in interface MessageSourceResolvable
public Object[] getArguments()
getArguments
in interface MessageSourceResolvable
public String getDefaultMessage()
getDefaultMessage
in interface MessageSourceResolvable
Copyright © 2023. All rights reserved.