package org.jxmpp.jid.parts;

import org.jxmpp.stringprep.XmppStringPrepUtil;
import org.jxmpp.stringprep.XmppStringprepException;

public class Resourcepart extends Part {
   public static final Resourcepart EMPTY = new Resourcepart("");

   private Resourcepart(String resource) {
      super(resource);
   }

   public static Resourcepart from(String resource) throws XmppStringprepException {
      resource = XmppStringPrepUtil.resourceprep(resource);
      assertNotLongerThan1023BytesOrEmpty(resource);
      return new Resourcepart(resource);
   }
}
