Class Resourcepart

    • Field Detail

      • EMPTY

        public static final Resourcepart EMPTY
        The empty resource part.

        This empty resource part is the part that is represented by the empty String. This is useful in cases where you have a collection of Resourceparts that does not allow null values, but you want to deal with the "no resource" case.

    • Method Detail

      • fromOrNull

        public static Resourcepart fromOrNull​(java.lang.CharSequence cs)
        Get a Resourcepart from a given CharSequence or null if the input is not a valid resourcepart.
        Parameters:
        cs - the input CharSequence
        Returns:
        a Resourcepart or null
      • fromOrThrowUnchecked

        public static Resourcepart fromOrThrowUnchecked​(java.lang.CharSequence cs)
        Like from(String) but does throw an unchecked IllegalArgumentException instead of a XmppStringprepException.
        Parameters:
        cs - the character sequence which should be transformed to a Resourcepart
        Returns:
        the Resourcepart if no exception occurs
        Throws:
        java.lang.IllegalArgumentException - if the given input is not a valid Resourcepart
        Since:
        0.6.2
        See Also:
        from(String)
      • from

        public static Resourcepart from​(java.lang.String resource)
                                 throws org.jxmpp.stringprep.XmppStringprepException
        Get the Resourcepart representing the input String.
        Parameters:
        resource - the input String.
        Returns:
        the resource part.
        Throws:
        org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
      • from

        public static Resourcepart from​(java.lang.String resource,
                                        org.jxmpp.JxmppContext context)
                                 throws org.jxmpp.stringprep.XmppStringprepException
        Get the Resourcepart representing the input String.
        Parameters:
        resource - the input String.
        context - the JXMPP context.
        Returns:
        the resource part.
        Throws:
        org.jxmpp.stringprep.XmppStringprepException - if an error occurs.