Java Code Examples for org.jxmpp.jid.impl.JidCreate#domainFullFrom()

The following examples show how to use org.jxmpp.jid.impl.JidCreate#domainFullFrom() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WrappedJid.java    From Pix-Art-Messenger with GNU General Public License v3.0 6 votes vote down vote up
@Override
public eu.siacs.conversations.xmpp.Jid withResource(CharSequence resource) {
    final Localpart localpart = inner.getLocalpartOrNull();
    try {
        final Resourcepart resourcepart = Resourcepart.from(resource.toString());
        if (localpart == null) {
            return new WrappedJid(JidCreate.domainFullFrom(inner.getDomain(),resourcepart));
        } else {
            return new WrappedJid(
                    JidCreate.fullFrom(
                            localpart,
                            inner.getDomain(),
                            resourcepart
                    ));
        }
    } catch (XmppStringprepException e) {
        throw new IllegalArgumentException(e);
    }
}
 
Example 2
Source File: WrappedJid.java    From Conversations with GNU General Public License v3.0 6 votes vote down vote up
@Override
public eu.siacs.conversations.xmpp.Jid withResource(CharSequence resource) {
    final Localpart localpart = inner.getLocalpartOrNull();
    try {
        final Resourcepart resourcepart = Resourcepart.from(resource.toString());
        if (localpart == null) {
            return new WrappedJid(JidCreate.domainFullFrom(inner.getDomain(),resourcepart));
        } else {
            return new WrappedJid(
                    JidCreate.fullFrom(
                            localpart,
                            inner.getDomain(),
                            resourcepart
                    ));
        }
    } catch (XmppStringprepException e) {
        throw new IllegalArgumentException(e);
    }
}
 
Example 3
Source File: Jid.java    From Pix-Art-Messenger with GNU General Public License v3.0 5 votes vote down vote up
static Jid ofDomainAndResource(CharSequence domain, CharSequence resource) {
    try {
        return new WrappedJid(
                JidCreate.domainFullFrom(
                        Domainpart.from(domain.toString()),
                        Resourcepart.from(resource.toString())
                ));
    } catch (XmppStringprepException e) {
        throw new IllegalArgumentException(e);
    }
}
 
Example 4
Source File: Jid.java    From Conversations with GNU General Public License v3.0 5 votes vote down vote up
static Jid ofDomainAndResource(CharSequence domain, CharSequence resource) {
    try {
        return new WrappedJid(
                JidCreate.domainFullFrom(
                        Domainpart.from(domain.toString()),
                        Resourcepart.from(resource.toString())
                ));
    } catch (XmppStringprepException e) {
        throw new IllegalArgumentException(e);
    }
}