Converts the JID into one with a resource part of resource.
resource
JID withResource(String resource) => JID(local, domain, resource);