/** * Sets the private use. * * <p>See RFC 5646 section 2.2.7. * * @param privateUse The private use. {@code null} if not defined. * * @throws LangTagException If the extension syntax is invalid. */ public void setPrivateUse(final String privateUse) throws LangTagException { if (privateUse == null) { this.privateUse = null; return; } ensureMaxLength(privateUse); if (! isPrivateUse(privateUse)) throw new LangTagException("Invalid private use subtag"); this.privateUse = privateUse.toLowerCase(); }