package org.jxmpp.jid.parts;

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

public class Localpart extends Part {
   private Localpart(String localpart) {
      super(localpart);
   }

   public static Localpart from(String localpart) throws XmppStringprepException {
      localpart = XmppStringPrepUtil.localprep(localpart);
      assertNotLongerThan1023BytesOrEmpty(localpart);
      return new Localpart(localpart);
   }
}
