Package rocks.xmpp.core.stream.model
Class StreamError
- java.lang.Object
-
- rocks.xmpp.core.stream.model.StreamError
-
- All Implemented Interfaces:
LanguageElement
,StreamElement
public final class StreamError extends Object implements StreamElement, LanguageElement
The implementation of the<stream:error/>
element.This class is immutable.
- See Also:
- 4.9. Stream Errors
-
-
Constructor Summary
Constructors Constructor Description StreamError(Condition condition)
Creates a stream error with only a condition.StreamError(Condition condition, Object extension)
Creates a stream error with a condition, optional text and an extension.StreamError(Condition condition, String text, Locale language)
Creates a stream error with a condition and a descriptive text.StreamError(Condition condition, String text, Locale language, Object extension)
Creates a stream error with a condition, optional text and an extension.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Condition
getCondition()
Gets the defined stream error condition orCondition.UNDEFINED_CONDITION
if the condition is unknown.Object
getExtension()
Gets the application specific condition, if any.Locale
getLanguage()
Gets the language of the error text.String
getText()
Gets the optional error text.String
toString()
-
-
-
Constructor Detail
-
StreamError
public StreamError(Condition condition)
Creates a stream error with only a condition.- Parameters:
condition
- The non-null condition.
-
StreamError
public StreamError(Condition condition, String text, Locale language)
Creates a stream error with a condition and a descriptive text.- Parameters:
condition
- The non-null condition.text
- The text.language
- May be null, but it should be present.
-
StreamError
public StreamError(Condition condition, Object extension)
Creates a stream error with a condition, optional text and an extension.- Parameters:
condition
- The non-null condition.extension
- The application-specific error extension.
-
StreamError
public StreamError(Condition condition, String text, Locale language, Object extension)
Creates a stream error with a condition, optional text and an extension.- Parameters:
condition
- The non-null condition.text
- The text.language
- May be null, but it should be present.extension
- The application-specific error extension.
-
-
Method Detail
-
getLanguage
public final Locale getLanguage()
Gets the language of the error text.- Specified by:
getLanguage
in interfaceLanguageElement
- Returns:
- The language.
-
getText
public final String getText()
Gets the optional error text.- Returns:
- The text.
-
getExtension
public final Object getExtension()
Gets the application specific condition, if any.- Returns:
- The application specific condition.
- See Also:
- 4.9.4. Application-Specific Conditions
-
getCondition
public final Condition getCondition()
Gets the defined stream error condition orCondition.UNDEFINED_CONDITION
if the condition is unknown.- Returns:
- The error condition.
- See Also:
- 4.9.3. Defined Stream Error Conditions
-
-