Class Activity
- java.lang.Object
-
- rocks.xmpp.extensions.activity.model.Activity
-
public final class Activity extends Object
The implementation of the<activity/>element in thehttp://jabber.org/protocol/activitynamespace.
This class is immutable.Each activity has a REQUIRED general category and an OPTIONAL specific instance. One can understand each specifier as '[user] is [activity]' (e.g., 'Juliet is partying'), where the relevant value is the most specific activity provided (e.g., specifically "partying" rather than generally "relaxing").
- See Also:
- XEP-0108: User Activity, XML Schema
-
-
Constructor Summary
Constructors Constructor Description Activity()Creates an empty activity which is used to disable publishing an activity.Activity(Category category)Creates an activity with a category.Activity(Category category, String text)Creates an activity with a category and text.Activity(Category category, SpecificActivity specificActivity)Creates an activity with a category and a specific activity.Activity(Category category, SpecificActivity specificActivity, String text)Creates an activity with a category, a specific activity and a text.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CategorygetCategory()Gets the category.SpecificActivitygetSpecificActivity()Gets the specific activity.StringgetText()Gets the text of the activity.StringtoString()
-
-
-
Field Detail
-
NAMESPACE
public static final String NAMESPACE
http://jabber.org/protocol/activity- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Activity
public Activity()
Creates an empty activity which is used to disable publishing an activity.
-
Activity
public Activity(Category category)
Creates an activity with a category.- Parameters:
category- The category.
-
Activity
public Activity(Category category, String text)
Creates an activity with a category and text.- Parameters:
category- The category.text- The text.
-
Activity
public Activity(Category category, SpecificActivity specificActivity)
Creates an activity with a category and a specific activity.- Parameters:
category- The category.specificActivity- The specific activity.
-
Activity
public Activity(Category category, SpecificActivity specificActivity, String text)
Creates an activity with a category, a specific activity and a text.- Parameters:
category- The category.specificActivity- The specific activity.text- The text.
-
-
Method Detail
-
getText
public final String getText()
Gets the text of the activity.- Returns:
- The text.
-
getCategory
public final Category getCategory()
Gets the category.- Returns:
- The category.
-
getSpecificActivity
public final SpecificActivity getSpecificActivity()
Gets the specific activity.- Returns:
- The activity.
-
-