Enum SubscriptionState.Subscription

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      BOTH
      The user and the contact have subscriptions to each other's presence (also called a "mutual subscription").
      FROM
      The contact has a subscription to the user's presence, but the user does not have a subscription to the contact's presence.
      NONE
      The user does not have a subscription to the contact's presence, and the contact does not have a subscription to the user's presence; this is the default value, so if the subscription attribute is not included then the state is to be understood as "none".
      REMOVE
      At any time, a client can delete an item from his or her roster by sending a roster set and specifying a value of "remove" for the 'subscription' attribute.
      TO
      The user has a subscription to the contact's presence, but the contact does not have a subscription to the user's presence.
    • Enum Constant Detail

      • BOTH

        public static final SubscriptionState.Subscription BOTH
        The user and the contact have subscriptions to each other's presence (also called a "mutual subscription").
      • FROM

        public static final SubscriptionState.Subscription FROM
        The contact has a subscription to the user's presence, but the user does not have a subscription to the contact's presence.
      • TO

        public static final SubscriptionState.Subscription TO
        The user has a subscription to the contact's presence, but the contact does not have a subscription to the user's presence.
      • NONE

        public static final SubscriptionState.Subscription NONE
        The user does not have a subscription to the contact's presence, and the contact does not have a subscription to the user's presence; this is the default value, so if the subscription attribute is not included then the state is to be understood as "none".
      • REMOVE

        public static final SubscriptionState.Subscription REMOVE
        At any time, a client can delete an item from his or her roster by sending a roster set and specifying a value of "remove" for the 'subscription' attribute.
    • Method Detail

      • values

        public static SubscriptionState.Subscription[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (SubscriptionState.Subscription c : SubscriptionState.Subscription.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static SubscriptionState.Subscription valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • userHasSubscriptionToContact

        public final boolean userHasSubscriptionToContact()
        Returns true, if the user has a subscription to the contact, e.g. if the subscription state is TO or BOTH.
        Returns:
        True, if the subscription state is TO or BOTH.
      • contactHasSubscriptionToUser

        public final boolean contactHasSubscriptionToUser()
        Returns true, if the contact has a subscription to the user, e.g. if the subscription state is FROM or BOTH.
        Returns:
        True, if the subscription state is FROM or BOTH.