com.atlassian.confluence.api.model.messages
Class SimpleMessage

java.lang.Object
  extended by com.atlassian.confluence.api.model.messages.SimpleMessage
All Implemented Interfaces:
Message

@ExperimentalApi
public class SimpleMessage
extends java.lang.Object
implements Message

Simple immutable implementation of Message.

Since:
5.6

Method Summary
static SimpleMessage copyOf(Message message)
           
 java.lang.Object[] getArgs()
           
 java.lang.String getKey()
           
 java.lang.String getTranslation()
           
static SimpleMessage withKeyAndArgs(java.lang.String key, java.lang.Object... args)
          Creates a new SimpleMessage with the given key and arguments.
static SimpleMessage withTranslation(java.lang.String translation)
          Used when a message only has a translated string at creation time, usually in English.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

withKeyAndArgs

public static SimpleMessage withKeyAndArgs(java.lang.String key,
                                           java.lang.Object... args)
Creates a new SimpleMessage with the given key and arguments.


withTranslation

public static SimpleMessage withTranslation(java.lang.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 java.lang.String getKey()
Specified by:
getKey in interface Message
Returns:
the i18n key of this message

getArgs

public java.lang.Object[] getArgs()
Specified by:
getArgs in interface Message
Returns:
the arguments to this message. May be null or an empty array.

getTranslation

public java.lang.String getTranslation()
Specified by:
getTranslation in interface Message
Returns:
the translated message, may be null if this message has not been translated yet.

copyOf

public static SimpleMessage copyOf(Message message)


Copyright © 2003-2014 Atlassian. All Rights Reserved.