Class SimpleMessage
- java.lang.Object
-
- com.atlassian.confluence.api.model.messages.SimpleMessage
-
- All Implemented Interfaces:
Message<SimpleMessage>,Comparable<SimpleMessage>
@ExperimentalApi public class SimpleMessage extends Object implements Message<SimpleMessage>
Simple immutable implementation ofMessage.- Since:
- 5.6
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSimpleMessage.SimpleMessageBuilder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SimpleMessage.SimpleMessageBuilderbuilder()static SimpleMessagecopyOf(Message message)booleanequals(Object obj)Object[]getArgs()StringgetKey()StringgetTranslation()inthashCode()StringtoString()static SimpleMessagewithKeyAndArgs(String key, Object... args)Creates a new SimpleMessage with the given key and arguments.static SimpleMessagewithTranslation(String translation)Used when a message only has a translated string at creation time, usually in English.
-
-
-
Method Detail
-
builder
public static SimpleMessage.SimpleMessageBuilder builder()
-
withKeyAndArgs
public static SimpleMessage withKeyAndArgs(String key, Object... args)
Creates a new SimpleMessage with the given key and arguments.
-
withTranslation
public static SimpleMessage withTranslation(String translation)
Used when a message only has a translated string at creation time, usually in English.Use of this method is discouraged - try to use
withKeyAndArgs(String, Object...)whenever possible.
-
getKey
public String getKey()
- Specified by:
getKeyin interfaceMessage<SimpleMessage>- Returns:
- the i18n key of this message
-
getArgs
public Object[] getArgs()
- Specified by:
getArgsin interfaceMessage<SimpleMessage>- Returns:
- the arguments to this message. May be null or an empty array.
-
getTranslation
public String getTranslation()
- Specified by:
getTranslationin interfaceMessage<SimpleMessage>- Returns:
- the translated message, may be null if this message has not been translated yet.
-
copyOf
public static SimpleMessage copyOf(Message message)
-
-