public final class StreamError extends java.lang.Object implements StreamElement
The implementation of the <stream:error/>
element.
This class is immutable.
Constructor and Description |
---|
StreamError(Condition condition)
Creates a stream error with only a condition.
|
StreamError(Condition condition,
java.lang.Object extension)
Creates a stream error with a condition, optional text and an extension.
|
StreamError(Condition condition,
java.lang.String text,
java.util.Locale language)
Creates a stream error with a condition and a descriptive text.
|
StreamError(Condition condition,
java.lang.String text,
java.util.Locale language,
java.lang.Object extension)
Creates a stream error with a condition, optional text and an extension.
|
Modifier and Type | Method and Description |
---|---|
Condition |
getCondition()
Gets the defined stream error condition or
Condition.UNDEFINED_CONDITION if the condition is unknown. |
java.lang.Object |
getExtension()
Gets the application specific condition, if any.
|
java.util.Locale |
getLanguage()
Gets the language of the error text.
|
java.lang.String |
getText()
Gets the optional error text.
|
java.lang.String |
toString() |
public StreamError(Condition condition)
Creates a stream error with only a condition.
condition
- The non-null condition.public StreamError(Condition condition, java.lang.String text, java.util.Locale language)
Creates a stream error with a condition and a descriptive text.
condition
- The non-null condition.text
- The text.language
- May be null, but it should be present.public StreamError(Condition condition, java.lang.Object extension)
Creates a stream error with a condition, optional text and an extension.
condition
- The non-null condition.extension
- The application-specific error extension.public StreamError(Condition condition, java.lang.String text, java.util.Locale language, java.lang.Object extension)
Creates a stream error with a condition, optional text and an extension.
condition
- The non-null condition.text
- The text.language
- May be null, but it should be present.extension
- The application-specific error extension.public final java.util.Locale getLanguage()
Gets the language of the error text.
public final java.lang.String getText()
Gets the optional error text.
public final java.lang.Object getExtension()
Gets the application specific condition, if any.
public final Condition getCondition()
Gets the defined stream error condition or Condition.UNDEFINED_CONDITION
if the condition is unknown.
public final java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2014–2019 XMPP.rocks. All rights reserved.