invitation.inviter = JidCreate.entityFrom(inviterString);
/** * Get a {@link EntityJid} representing the given String. * * @param jidString the JID's string. * @return an entity JID representing the given String. * @throws XmppStringprepException if an error occurs. */ public static EntityJid entityFromUnescaped(String jidString) throws XmppStringprepException { return entityFrom(jidString, true); }
/** * Get a {@link EntityJid} representing the given String. * * @param jidString the JID's string. * @return an entity JID representing the given String. * @throws XmppStringprepException if an error occurs. */ public static EntityJid entityFrom(String jidString) throws XmppStringprepException { return entityFrom(jidString, false); }
/** * Get a {@link EntityJid} from a given {@link CharSequence} or {@code null} if the input does not represent a JID. * * @param cs the input {@link CharSequence} * @return a JID or {@code null} */ public static EntityJid entityFromOrNull(CharSequence cs) { try { return entityFrom(cs); } catch (XmppStringprepException e) { return null; } }
/** * Get a {@link EntityJid} representing the given String. * * @param jid the JID's string. * @return an entity JID representing the given String. * @throws XmppStringprepException if an error occurs. */ public static EntityJid entityFrom(CharSequence jid) throws XmppStringprepException { return entityFrom(jid.toString()); }
/** * Like {@link #entityFrom(CharSequence)} but does throw an unchecked {@link IllegalArgumentException} instead of a * {@link XmppStringprepException}. * * @param cs the character sequence which should be transformed to a {@link EntityJid} * @return the {@link EntityJid} if no exception occurs * @throws IllegalArgumentException if the given input is not a valid JID * @see #entityFrom(CharSequence) * @since 0.6.2 */ public static EntityJid entityFromOrThrowUnchecked(CharSequence cs) { try { return entityFrom(cs); } catch (XmppStringprepException e) { throw new IllegalArgumentException(e); } }
/** * Set the XMPP address of the participant. * * @param jidString the XMPP address * @deprecated use {@link #setparticipantJID(EntityJid)} instead. */ @Deprecated private void setparticipantJID(String jidString) { EntityJid jid; try { jid = JidCreate.entityFrom(jidString); } catch (XmppStringprepException e) { throw new IllegalStateException(e); } setparticipantJID(jid); }