/** * Sets a custom (non-registered) parameter. * * @param name The name of the custom parameter. Must not * match a registered parameter name and must not * be {@code null}. * @param value The value of the custom parameter, should map * to a valid JSON entity, {@code null} if not * specified. * * @return This builder. * * @throws IllegalArgumentException If the specified parameter * name matches a registered * parameter name. */ public Builder customParam(final String name, final Object value) { if (getRegisteredParameterNames().contains(name)) { throw new IllegalArgumentException("The parameter name \"" + name + "\" matches a registered name"); } if (customParams == null) { customParams = new HashMap<>(); } customParams.put(name, value); return this; }