Class Activity


  • public final class Activity
    extends Object
    The implementation of the <activity/> element in the http://jabber.org/protocol/activity namespace.

    3. Activity Values

    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").

    This class is immutable.
    See Also:
    XEP-0108: User Activity, XML Schema
    • 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.