/** * Adds a path part to the url. * <p> * Once the first parameter has been added, the path can no longer be modified. * * @param uriPartsToAdd the uri part to add. This should not contain a leading '/' as it is added automatically. If * an array (vararg) is given, all components are appended to the internal {@link * StringBuilder} without any additional characters. * @return the builder itself for fluent method calls */ public URLBuilder addPart(@Nonnull String... uriPartsToAdd) { url.append("/"); for (String uriPart : uriPartsToAdd) { if (Strings.isFilled(uriPart)) { if (questionMark.isToggled()) { throw new IllegalStateException(Strings.apply( "Cannot add '%s'! Parameters where already added to: '%s'.", uriPart, url)); } url.append(uriPart); } } return this; }