public class SpoilerElement
extends java.lang.Object
implements org.jivesoftware.smack.packet.ExtensionElement
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ELEMENT |
static SpoilerElement |
EMPTY |
static java.lang.String |
NAMESPACE |
Constructor and Description |
---|
SpoilerElement(java.lang.String language,
java.lang.String hint)
Create a new SpoilerElement with a hint about a content and a language attribute.
|
Modifier and Type | Method and Description |
---|---|
static void |
addSpoiler(org.jivesoftware.smack.packet.Message message)
Add a SpoilerElement to a message.
|
static void |
addSpoiler(org.jivesoftware.smack.packet.Message message,
java.lang.String hint)
Add a SpoilerElement with a hint to a message.
|
static void |
addSpoiler(org.jivesoftware.smack.packet.Message message,
java.lang.String lang,
java.lang.String hint)
Add a SpoilerElement with a hint in a certain language to a message.
|
static boolean |
containsSpoiler(org.jivesoftware.smack.packet.Message message)
Returns true, if the message has at least one spoiler element.
|
java.lang.String |
getElementName() |
java.lang.String |
getHint()
Return the hint text of the spoiler.
|
java.lang.String |
getLanguage()
Return the language of the hint.
|
java.lang.String |
getNamespace() |
static java.util.Map<java.lang.String,java.lang.String> |
getSpoilers(org.jivesoftware.smack.packet.Message message)
Return a map of all spoilers contained in a message.
|
java.lang.CharSequence |
toXML(java.lang.String enclosingNamespace) |
public static final java.lang.String ELEMENT
public static final java.lang.String NAMESPACE
public static final SpoilerElement EMPTY
public SpoilerElement(java.lang.String language, java.lang.String hint)
language
- language of the hint.hint
- hint about the content.public java.lang.String getHint()
public static void addSpoiler(org.jivesoftware.smack.packet.Message message)
message
- message to add the Spoiler to.public static void addSpoiler(org.jivesoftware.smack.packet.Message message, java.lang.String hint)
message
- Message to add the Spoiler to.hint
- Hint about the Spoilers content.public static void addSpoiler(org.jivesoftware.smack.packet.Message message, java.lang.String lang, java.lang.String hint)
message
- Message to add the Spoiler to.lang
- language of the Spoiler hint.hint
- hint.public static boolean containsSpoiler(org.jivesoftware.smack.packet.Message message)
message
- messagepublic static java.util.Map<java.lang.String,java.lang.String> getSpoilers(org.jivesoftware.smack.packet.Message message)
message
- messagepublic java.lang.String getLanguage()
public java.lang.String getNamespace()
getNamespace
in interface org.jivesoftware.smack.packet.ExtensionElement
public java.lang.String getElementName()
getElementName
in interface org.jivesoftware.smack.packet.NamedElement
public java.lang.CharSequence toXML(java.lang.String enclosingNamespace)
toXML
in interface org.jivesoftware.smack.packet.Element