Class JidCreate

java.lang.Object
org.jxmpp.jid.impl.JidCreate

public class JidCreate extends Object
API to create JIDs (XMPP addresses) from Strings and CharSequences.

If the input was user generated, e.g. captured from some sort of user interface, fromUnescaped(String) should be used instead. This allows the user to enter unescaped JID values. You can use JidUtil.isValidEntityBareJid(CharSequence) to query, e.g. while the user it entering it, if a given CharSequence is a valid bare JID.

JIDs created from input received from an XMPP source should use from(String).

JidCreate uses caches for efficient Jid construction, But it's not guaranteed that the same String or CharSequence will yield the same Jid instance.

See Also:
  • Constructor Details

    • JidCreate

      public JidCreate()
  • Method Details

    • from

      public static Jid from(CharSequence localpart, CharSequence domainpart, CharSequence resource) throws org.jxmpp.stringprep.XmppStringprepException
      Get a Jid from the given parts.

      Only the domainpart is required.

      Parameters:
      localpart - a optional localpart.
      domainpart - a required domainpart.
      resource - a optional resourcepart.
      Returns:
      a JID which consists of the given parts.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
    • from

      public static Jid from(String localpart, String domainpart, String resource) throws org.jxmpp.stringprep.XmppStringprepException
      Get a Jid from the given parts.

      Only the domainpart is required.

      Parameters:
      localpart - a optional localpart.
      domainpart - a required domainpart.
      resource - a optional resourcepart.
      Returns:
      a JID which consists of the given parts.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
    • from

      public static Jid from(String localpart, String domainpart, String resource, org.jxmpp.JxmppContext context) throws org.jxmpp.stringprep.XmppStringprepException
      Get a Jid from the given parts.

      Only the domainpart is required.

      Parameters:
      localpart - a optional localpart.
      domainpart - a required domainpart.
      resource - a optional resourcepart.
      context - the JXMPP context.
      Returns:
      a JID which consists of the given parts.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
    • fromOrThrowUnchecked

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

      public static Jid from(CharSequence jid) throws org.jxmpp.stringprep.XmppStringprepException
      Get a Jid from a CharSequence.
      Parameters:
      jid - the input CharSequence.
      Returns:
      the Jid represented by the input CharSequence.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
      See Also:
    • from

      public static Jid from(String jidString) throws org.jxmpp.stringprep.XmppStringprepException
      Get a Jid from the given String.
      Parameters:
      jidString - the input String.
      Returns:
      the Jid represented by the input String.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
      See Also:
    • from

      public static Jid from(String jidString, org.jxmpp.JxmppContext context) throws org.jxmpp.stringprep.XmppStringprepException
      Get a Jid from the given String.
      Parameters:
      jidString - the input String.
      context - the JXMPP context.
      Returns:
      the Jid represented by the input String.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
      See Also:
    • fromOrNull

      public static Jid fromOrNull(CharSequence cs)
      Get a Jid from a given CharSequence or null if the input does not represent a JID.
      Parameters:
      cs - the input CharSequence
      Returns:
      a JID or null
    • fromUnescapedOrThrowUnchecked

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

      public static Jid fromUnescaped(CharSequence unescapedJid) throws org.jxmpp.stringprep.XmppStringprepException
      Get a Jid from the given unescaped CharSequence.
      Parameters:
      unescapedJid - an unescaped CharSequence representing a JID.
      Returns:
      a JID.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
    • fromUnescaped

      public static Jid fromUnescaped(String unescapedJidString) throws org.jxmpp.stringprep.XmppStringprepException
      Get a Jid from the given unescaped String.
      Parameters:
      unescapedJidString - a unescaped String representing a JID.
      Returns:
      a JID.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
    • fromUnescapedOrNull

      public static Jid fromUnescapedOrNull(CharSequence cs)
      Get a Jid from a given CharSequence or null if the input does not represent a JID.
      Parameters:
      cs - the input CharSequence
      Returns:
      a JID or null
    • fromUrlEncoded

      public static Jid fromUrlEncoded(CharSequence cs) throws org.jxmpp.stringprep.XmppStringprepException
      Get a Jid from an URL encoded CharSequence.
      Parameters:
      cs - a CharSequence representing an URL encoded JID.
      Returns:
      a JID
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
      See Also:
    • bareFromOrThrowUnchecked

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

      public static BareJid bareFrom(CharSequence jid) throws org.jxmpp.stringprep.XmppStringprepException
      Get a BareJid representing the given CharSequence.
      Parameters:
      jid - the input CharSequence.
      Returns:
      a bare JID representing the given CharSequence.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
    • bareFrom

      public static BareJid bareFrom(String jid) throws org.jxmpp.stringprep.XmppStringprepException
      Get a BareJid representing the given String.
      Parameters:
      jid - the input String.
      Returns:
      a bare JID representing the given String.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
    • bareFrom

      public static BareJid bareFrom(String jid, org.jxmpp.JxmppContext context) throws org.jxmpp.stringprep.XmppStringprepException
      Get a BareJid representing the given String.
      Parameters:
      jid - the input String.
      context - the JXMPP context.
      Returns:
      a bare JID representing the given String.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
    • bareFrom

      public static BareJid bareFrom(Localpart localpart, DomainBareJid domainBareJid)
      Get a BareJid constructed from the optionally given Localpart and {link DomainBareJid}.
      Parameters:
      localpart - a optional localpart.
      domainBareJid - a domain bare JID.
      Returns:
      a bare JID.
    • bareFrom

      public static BareJid bareFrom(Localpart localpart, Domainpart domain)
      Get a BareJid constructed from the optionally given Localpart and Domainpart.
      Parameters:
      localpart - a optional localpart.
      domain - a domainpart.
      Returns:
      a bare JID constructed from the given parts.
    • bareFromOrNull

      public static BareJid bareFromOrNull(CharSequence cs)
      Get a BareJid from a given CharSequence or null if the input does not represent a JID.
      Parameters:
      cs - the input CharSequence
      Returns:
      a JID or null
    • bareFromUrlEncoded

      public static BareJid bareFromUrlEncoded(CharSequence cs) throws org.jxmpp.stringprep.XmppStringprepException
      Get a BareJid from an URL encoded CharSequence.
      Parameters:
      cs - a CharSequence representing an URL encoded bare JID.
      Returns:
      a bare JID
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
      See Also:
    • fullFromOrThrowUnchecked

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

      public static FullJid fullFrom(CharSequence jid) throws org.jxmpp.stringprep.XmppStringprepException
      Get a FullJid representing the given CharSequence.
      Parameters:
      jid - a CharSequence representing a JID.
      Returns:
      a full JID representing the given CharSequence.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
    • fullFrom

      public static FullJid fullFrom(String jid) throws org.jxmpp.stringprep.XmppStringprepException
      Get a FullJid representing the given String.
      Parameters:
      jid - the JID's String.
      Returns:
      a full JID representing the input String.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
    • fullFrom

      public static FullJid fullFrom(String jid, org.jxmpp.JxmppContext context) throws org.jxmpp.stringprep.XmppStringprepException
      Get a FullJid representing the given String.
      Parameters:
      jid - the JID's String.
      context - the JXMPP context.
      Returns:
      a full JID representing the input String.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
    • fullFrom

      public static FullJid fullFrom(String localpart, String domainpart, String resource) throws org.jxmpp.stringprep.XmppStringprepException
      Get a FullJid constructed from the given parts.
      Parameters:
      localpart - a optional localpart.
      domainpart - a domainpart.
      resource - a resourcepart.
      Returns:
      a full JID.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
    • fullFrom

      public static FullJid fullFrom(String localpart, String domainpart, String resource, org.jxmpp.JxmppContext context) throws org.jxmpp.stringprep.XmppStringprepException
      Get a FullJid constructed from the given parts.
      Parameters:
      localpart - a optional localpart.
      domainpart - a domainpart.
      resource - a resourcepart.
      context - the JXMPP context.
      Returns:
      a full JID.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
    • fullFrom

      public static FullJid fullFrom(Localpart localpart, DomainBareJid domainBareJid, Resourcepart resource)
      Get a FullJid constructed from the given parts.
      Parameters:
      localpart - a optional localpart.
      domainBareJid - a domain bare JID.
      resource - a resourcepart
      Returns:
      a full JID.
    • fullFrom

      public static FullJid fullFrom(Localpart localpart, Domainpart domainpart, Resourcepart resource)
      Get a FullJid constructed from the given parts.
      Parameters:
      localpart - the optional localpart.
      domainpart - the domainpart.
      resource - the resourcepart.
      Returns:
      a full JID.
    • fullFrom

      public static FullJid fullFrom(BareJid bareJid, Resourcepart resource)
      Get a FullJid constructed from a BareJid and a Resourcepart.
      Parameters:
      bareJid - a entity bare JID.
      resource - a resourcepart.
      Returns:
      a full JID.
    • fullFromOrNull

      public static FullJid fullFromOrNull(CharSequence cs)
      Get a FullJid from a given CharSequence or null if the input does not represent a JID.
      Parameters:
      cs - the input CharSequence
      Returns:
      a JID or null
    • fullFromUrlEncoded

      public static FullJid fullFromUrlEncoded(CharSequence cs) throws org.jxmpp.stringprep.XmppStringprepException
      Get a FullJid from an URL encoded CharSequence.
      Parameters:
      cs - a CharSequence representing an URL encoded full JID.
      Returns:
      a full JID
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
      See Also:
    • entityFromOrThrowUnchecked

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

      public static EntityJid entityFrom(CharSequence jid) throws org.jxmpp.stringprep.XmppStringprepException
      Get a EntityJid representing the given String.
      Parameters:
      jid - the JID's string.
      Returns:
      an entity JID representing the given String.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
    • entityFrom

      public static EntityJid entityFrom(String jidString) throws org.jxmpp.stringprep.XmppStringprepException
      Get a EntityJid representing the given String.
      Parameters:
      jidString - the JID's string.
      Returns:
      an entity JID representing the given String.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
    • entityFrom

      public static EntityJid entityFrom(String jidString, org.jxmpp.JxmppContext context) throws org.jxmpp.stringprep.XmppStringprepException
      Get a EntityJid representing the given String.
      Parameters:
      jidString - the JID's string.
      context - the JXMPP context.
      Returns:
      an entity JID representing the given String.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
    • entityFromUnescapedOrThrowUnchecked

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

      public static EntityJid entityFromUnescapedOrThrowUnchecked(CharSequence cs, org.jxmpp.JxmppContext context)
      Like entityFromUnescaped(CharSequence) but does throw an unchecked IllegalArgumentException instead of a XmppStringprepException.
      Parameters:
      cs - the character sequence which should be transformed to a EntityJid
      context - the JXMPP context.
      Returns:
      the EntityJid if no exception occurs
      Throws:
      IllegalArgumentException - if the given input is not a valid JID
      Since:
      0.6.2
      See Also:
    • entityFromUnescaped

      public static EntityJid entityFromUnescaped(CharSequence jid) throws org.jxmpp.stringprep.XmppStringprepException
      Get a EntityJid representing the given String.
      Parameters:
      jid - the JID.
      Returns:
      an entity JID representing the given input..
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
    • entityFromUnescaped

      public static EntityJid entityFromUnescaped(CharSequence jid, org.jxmpp.JxmppContext context) throws org.jxmpp.stringprep.XmppStringprepException
      Get a EntityJid representing the given String.
      Parameters:
      jid - the JID.
      context - the JXMPP context.
      Returns:
      an entity JID representing the given input.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
    • entityFromUnescaped

      public static EntityJid entityFromUnescaped(String jidString) throws org.jxmpp.stringprep.XmppStringprepException
      Get a EntityJid representing the given String.
      Parameters:
      jidString - the JID's string.
      Returns:
      an entity JID representing the given String.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
    • entityFromUnescaped

      public static EntityJid entityFromUnescaped(String jidString, org.jxmpp.JxmppContext context) throws org.jxmpp.stringprep.XmppStringprepException
      Get a EntityJid representing the given String.
      Parameters:
      jidString - the JID's string.
      context - the JXMPP context.
      Returns:
      an entity JID representing the given String.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
    • entityFromUnesacpedOrNull

      @Deprecated public static EntityJid entityFromUnesacpedOrNull(CharSequence cs)
      Deprecated.
      Get a EntityJid from a given CharSequence or null if the input does not represent a JID.
      Parameters:
      cs - the input CharSequence
      Returns:
      a JID or null
    • entityFromUnescapedOrNull

      public static EntityJid entityFromUnescapedOrNull(CharSequence cs)
      Get a EntityJid from a given CharSequence or null if the input does not represent a JID.
      Parameters:
      cs - the input CharSequence
      Returns:
      a JID or null
    • entityFromOrNull

      public static EntityJid entityFromOrNull(CharSequence cs)
      Get a EntityJid from a given CharSequence or null if the input does not represent a JID.
      Parameters:
      cs - the input CharSequence
      Returns:
      a JID or null
    • entityFromUrlEncoded

      public static EntityJid entityFromUrlEncoded(CharSequence cs) throws org.jxmpp.stringprep.XmppStringprepException
      Get a EntityJid from an URL encoded CharSequence.
      Parameters:
      cs - a CharSequence representing an URL encoded entity JID.
      Returns:
      an entity JID
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
      See Also:
    • entityBareFromOrThrowUnchecked

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

      public static EntityBareJid entityBareFrom(CharSequence jid) throws org.jxmpp.stringprep.XmppStringprepException
      Get a EntityBareJid representing the given CharSequence.
      Parameters:
      jid - the input CharSequence.
      Returns:
      a bare JID representing the given CharSequence.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
    • entityBareFrom

      public static EntityBareJid entityBareFrom(String jid) throws org.jxmpp.stringprep.XmppStringprepException
      Get a EntityBareJid representing the given String.
      Parameters:
      jid - the input String.
      Returns:
      a bare JID representing the given String.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
    • entityBareFrom

      public static EntityBareJid entityBareFrom(String jid, org.jxmpp.JxmppContext context) throws org.jxmpp.stringprep.XmppStringprepException
      Get a EntityBareJid representing the given String.
      Parameters:
      jid - the input String.
      context - the JXMPP context.
      Returns:
      a bare JID representing the given String.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
    • entityBareFromUnescapedOrThrowUnchecked

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

      public static EntityBareJid entityBareFromUnescaped(CharSequence unescapedJid) throws org.jxmpp.stringprep.XmppStringprepException
      Get a EntityBareJid representing the given unescaped CharSequence.
      Parameters:
      unescapedJid - the input CharSequence.
      Returns:
      a bare JID representing the given CharSequence.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
    • entityBareFromUnescaped

      public static EntityBareJid entityBareFromUnescaped(String unescapedJidString) throws org.jxmpp.stringprep.XmppStringprepException
      Get a EntityBareJid representing the given unescaped String.
      Parameters:
      unescapedJidString - the input String.
      Returns:
      a bare JID representing the given String.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
    • entityBareFromUnescaped

      public static EntityBareJid entityBareFromUnescaped(String unescapedJidString, org.jxmpp.JxmppContext context) throws org.jxmpp.stringprep.XmppStringprepException
      Get a EntityBareJid representing the given unescaped String.
      Parameters:
      unescapedJidString - the input String.
      context - the JXMPP context.
      Returns:
      a bare JID representing the given String.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
    • entityBareFromUnescapedOrNull

      public static EntityBareJid entityBareFromUnescapedOrNull(CharSequence cs)
      Get a EntityBareJid from a given CharSequence or null if the input does not represent a JID.
      Parameters:
      cs - the input CharSequence
      Returns:
      a JID or null
    • entityBareFrom

      public static EntityBareJid entityBareFrom(Localpart localpart, DomainBareJid domainBareJid)
      Get a EntityBareJid constructed from the given Localpart and {link DomainBareJid}.
      Parameters:
      localpart - a localpart.
      domainBareJid - a domain bare JID.
      Returns:
      a bare JID.
    • entityBareFrom

      public static EntityBareJid entityBareFrom(Localpart localpart, Domainpart domain)
      Get a EntityBareJid constructed from the given Localpart and Domainpart.
      Parameters:
      localpart - a localpart.
      domain - a domainpart.
      Returns:
      a bare JID constructed from the given parts.
    • entityBareFromOrNull

      public static EntityBareJid entityBareFromOrNull(CharSequence cs)
      Get a EntityBareJid from a given CharSequence or null if the input does not represent a JID.
      Parameters:
      cs - the input CharSequence
      Returns:
      a JID or null
    • entityBareFromUrlEncoded

      public static EntityBareJid entityBareFromUrlEncoded(CharSequence cs) throws org.jxmpp.stringprep.XmppStringprepException
      Get a EntityBareJid from an URL encoded CharSequence.
      Parameters:
      cs - a CharSequence representing an URL encoded entity bare JID.
      Returns:
      an entity bare JID
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
      See Also:
    • entityFullFromOrThrowUnchecked

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

      public static EntityFullJid entityFullFrom(CharSequence jid) throws org.jxmpp.stringprep.XmppStringprepException
      Get a EntityFullJid representing the given CharSequence.
      Parameters:
      jid - a CharSequence representing a JID.
      Returns:
      a full JID representing the given CharSequence.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
    • entityFullFrom

      public static EntityFullJid entityFullFrom(String jid, org.jxmpp.JxmppContext context) throws org.jxmpp.stringprep.XmppStringprepException
      Get a EntityFullJid representing the given String.
      Parameters:
      jid - the JID's String.
      context - the JXMPP context.
      Returns:
      a full JID representing the input String.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
    • entityFullFromOrNull

      public static EntityFullJid entityFullFromOrNull(CharSequence cs)
      Get a EntityFullJid from a given CharSequence or null if the input does not represent a JID.
      Parameters:
      cs - the input CharSequence
      Returns:
      a JID or null
    • entityFullFromUnescapedOrThrowUnchecked

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

      public static EntityFullJid entityFullFromUnescaped(CharSequence unescapedJid) throws org.jxmpp.stringprep.XmppStringprepException
      Get a EntityFullJid representing the given unescaped CharSequence.
      Parameters:
      unescapedJid - a CharSequence representing a JID.
      Returns:
      a full JID representing the given CharSequence.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
    • entityFullFromUnescaped

      public static EntityFullJid entityFullFromUnescaped(String unescapedJidString) throws org.jxmpp.stringprep.XmppStringprepException
      Get a EntityFullJid representing the given unescaped String.
      Parameters:
      unescapedJidString - the JID's String.
      Returns:
      a full JID representing the input String.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
    • entityFullFromUnescaped

      public static EntityFullJid entityFullFromUnescaped(String unescapedJidString, org.jxmpp.JxmppContext context) throws org.jxmpp.stringprep.XmppStringprepException
      Get a EntityFullJid representing the given unescaped String.
      Parameters:
      unescapedJidString - the JID's String.
      context - the JXMPP context.
      Returns:
      a full JID representing the input String.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
    • entityFullFromUnescapedOrNull

      public static EntityFullJid entityFullFromUnescapedOrNull(CharSequence cs)
      Get a EntityFullJid from a given CharSequence or null if the input does not represent a JID.
      Parameters:
      cs - the input CharSequence
      Returns:
      a JID or null
    • entityFullFrom

      public static EntityFullJid entityFullFrom(String localpart, String domainpart, String resource) throws org.jxmpp.stringprep.XmppStringprepException
      Get a EntityFullJid constructed from the given parts.
      Parameters:
      localpart - a localpart.
      domainpart - a domainpart.
      resource - a resourcepart.
      Returns:
      a full JID.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
    • entityFullFrom

      public static EntityFullJid entityFullFrom(String localpart, String domainpart, String resource, org.jxmpp.JxmppContext context) throws org.jxmpp.stringprep.XmppStringprepException
      Get a EntityFullJid constructed from the given parts.
      Parameters:
      localpart - a localpart.
      domainpart - a domainpart.
      resource - a resourcepart.
      context - the JXMPP context.
      Returns:
      a full JID.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
    • entityFullFrom

      public static EntityFullJid entityFullFrom(Localpart localpart, DomainBareJid domainBareJid, Resourcepart resource)
      Get a EntityFullJid constructed from the given parts.
      Parameters:
      localpart - a localpart.
      domainBareJid - a domain bare JID..
      resource - a resourcepart
      Returns:
      a full JID.
    • entityFullFrom

      public static EntityFullJid entityFullFrom(Localpart localpart, Domainpart domainpart, Resourcepart resource)
      Get a EntityFullJid constructed from the given parts.
      Parameters:
      localpart - the localpart.
      domainpart - the domainpart.
      resource - the resourcepart.
      Returns:
      a full JID.
    • entityFullFrom

      public static EntityFullJid entityFullFrom(EntityBareJid bareJid, Resourcepart resource)
      Get a EntityFullJid constructed from a EntityBareJid and a Resourcepart.
      Parameters:
      bareJid - a bare JID.
      resource - a resourcepart.
      Returns:
      a full JID.
    • entityFullFromUrlEncoded

      public static EntityFullJid entityFullFromUrlEncoded(CharSequence cs) throws org.jxmpp.stringprep.XmppStringprepException
      Get a EntityFullJid from an URL encoded CharSequence.
      Parameters:
      cs - a CharSequence representing an URL encoded entity full JID.
      Returns:
      an entity full JID
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
      See Also:
    • domainBareFromOrThrowUnchecked

      public static DomainBareJid domainBareFromOrThrowUnchecked(CharSequence cs)
      Like domainBareFrom(CharSequence) but does throw an unchecked IllegalArgumentException instead of a XmppStringprepException.
      Parameters:
      cs - the character sequence which should be transformed to a EntityFullJid
      Returns:
      the EntityFullJid if no exception occurs
      Since:
      0.6.2
      See Also:
    • domainBareFrom

      public static DomainBareJid domainBareFrom(CharSequence jid) throws org.jxmpp.stringprep.XmppStringprepException
      Get a domain bare JID.
      Parameters:
      jid - the JID CharSequence.
      Returns:
      a domain bare JID.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
    • domainBareFrom

      public static DomainBareJid domainBareFrom(String jid) throws org.jxmpp.stringprep.XmppStringprepException
      Get a domain bare JID.
      Parameters:
      jid - the JID String.
      Returns:
      a domain bare JID.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
    • domainBareFrom

      public static DomainBareJid domainBareFrom(String jid, org.jxmpp.JxmppContext context) throws org.jxmpp.stringprep.XmppStringprepException
      Get a domain bare JID.
      Parameters:
      jid - the JID String.
      context - the JXMPP context.
      Returns:
      a domain bare JID.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
    • domainBareFrom

      public static DomainBareJid domainBareFrom(Domainpart domainpart)
      Get a DomainBareJid consisting of the given Domainpart.
      Parameters:
      domainpart - the domainpart.
      Returns:
      a domain bare JID.
    • domainBareFromOrNull

      public static DomainBareJid domainBareFromOrNull(CharSequence cs)
      Get a DomainBareJid from a given CharSequence or null if the input does not represent a JID.
      Parameters:
      cs - the input CharSequence
      Returns:
      a JID or null
    • domainBareFromUrlEncoded

      public static DomainBareJid domainBareFromUrlEncoded(CharSequence cs) throws org.jxmpp.stringprep.XmppStringprepException
      Get a DomainBareJid from an URL encoded CharSequence.
      Parameters:
      cs - a CharSequence representing an URL encoded domain bare JID.
      Returns:
      a domain bare JID
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
      See Also:
    • domainFullFromOrThrowUnchecked

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

      public static DomainFullJid domainFullFrom(CharSequence jid) throws org.jxmpp.stringprep.XmppStringprepException
      Get a domain full JID from the given CharSequence.
      Parameters:
      jid - the JID.
      Returns:
      a domain full JID.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error happens.
    • domainFullFrom

      public static DomainFullJid domainFullFrom(String jid) throws org.jxmpp.stringprep.XmppStringprepException
      Get a domain full JID from the given String.
      Parameters:
      jid - the JID.
      Returns:
      a DomainFullJid.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error happens.
    • domainFullFrom

      public static DomainFullJid domainFullFrom(String jid, org.jxmpp.JxmppContext context) throws org.jxmpp.stringprep.XmppStringprepException
      Get a domain full JID from the given String.
      Parameters:
      jid - the JID.
      context - the JXMPP context.
      Returns:
      a DomainFullJid.
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error happens.
    • domainFullFrom

      public static DomainFullJid domainFullFrom(Domainpart domainpart, Resourcepart resource)
      Get a domain full JID.
      Parameters:
      domainpart - the domainpart.
      resource - the resourcepart.
      Returns:
      a domain full JID.
    • domainFullFrom

      public static DomainFullJid domainFullFrom(DomainBareJid domainBareJid, Resourcepart resource)
      Get a domain full JID.
      Parameters:
      domainBareJid - a domain bare JID.
      resource - a resourcepart.
      Returns:
      a domain full JID.
    • domainFullFromOrNull

      public static DomainFullJid domainFullFromOrNull(CharSequence cs)
      Get a DomainFullJid from a given CharSequence or null if the input does not represent a JID.
      Parameters:
      cs - the input CharSequence
      Returns:
      a JID or null
    • domainFullFromUrlEncoded

      public static DomainFullJid domainFullFromUrlEncoded(CharSequence cs) throws org.jxmpp.stringprep.XmppStringprepException
      Get a DomainFullJid from an URL encoded CharSequence.
      Parameters:
      cs - a CharSequence representing an URL encoded domain full JID.
      Returns:
      a domain full JID
      Throws:
      org.jxmpp.stringprep.XmppStringprepException - if an error occurs.
      See Also: