/** * Get the {@link Localpart} representing the input String. * * @param localpart the input String. * @return the localpart. * @throws XmppStringprepException if an error occurs. */ public static Localpart from(String localpart) throws XmppStringprepException { localpart = XmppStringPrepUtil.localprep(localpart); // First prep the String, then assure the limits of the *result* assertNotLongerThan1023BytesOrEmpty(localpart); return new Localpart(localpart); } }