/** * Remove already registered values for the specified HTTP parameter, if any. * * @param sName * Parameter name * @return this */ @Nonnull public MockHttpServletRequest removeParameter (@Nonnull final String sName) { ValueEnforcer.notNull (sName, "Name"); m_aParameters.remove (sName); return this; }
/** * Set a single value for the specified HTTP parameter. * <p> * If there are already one or more values registered for the given parameter * name, they will be replaced. * * @param sName * Parameter name * @param sValue * Parameter value * @return this */ @Nonnull public MockHttpServletRequest setParameter (@Nonnull final String sName, @Nullable final String sValue) { m_aParameters.remove (sName); m_aParameters.add (sName, sValue); return this; }
/** * Set an array of values for the specified HTTP parameter. * <p> * If there are already one or more values registered for the given parameter * name, they will be replaced. * * @param sName * Parameter name * @param aValues * Parameter values * @return this */ @Nonnull public MockHttpServletRequest setParameter (@Nonnull final String sName, @Nullable final String [] aValues) { m_aParameters.remove (sName); m_aParameters.addAll (sName, aValues); return this; }
/** * Sets all provided parameters <em>replacing</em> any existing values for the * provided parameter names. To add without replacing existing values, use * {@link #addParameters(List)}. * * @param aParams * Parameter name value map. May be <code>null</code>. * @return this */ @Nonnull public MockHttpServletRequest setParameters (@Nullable final List <? extends URLParameter> aParams) { if (aParams != null) { for (final URLParameter aParam : aParams) m_aParameters.remove (aParam.getName ()); m_aParameters.addAll (aParams); } return this; }
@Nonnull public HCYouTubeIFrame setLanguage (@Nonnull final Locale aLocale) { ValueEnforcer.notNull (aLocale, "Locale"); ValueEnforcer.notEmpty (aLocale.getLanguage (), "Locale.getLanguage"); m_aVideoURL.params ().remove ("hl"); m_aVideoURL.add ("hl", aLocale.getLanguage ()); setSrc (m_aVideoURL); return this; } }
@Nonnull public HCYouTubeIFrame setAutoPlay (final boolean bAutoplay) { m_aVideoURL.params ().remove ("autoplay"); m_aVideoURL.params ().add ("autoplay", bAutoplay ? "1" : "0"); setSrc (m_aVideoURL); return this; }
@Nonnull public HCYouTubeIFrame setAllowFullscreen (final boolean bAllowFullscreen) { m_aVideoURL.params ().remove ("fs"); m_aVideoURL.params ().add ("fs", bAllowFullscreen ? "1" : "0"); setSrc (m_aVideoURL); return this; }
@Nonnull public HCYouTubeIFrame setShowRelated (final boolean bShowRelated) { m_aVideoURL.params ().remove ("rel"); m_aVideoURL.params ().add ("rel", bShowRelated ? "1" : "0"); setSrc (m_aVideoURL); return this; }