Class RequestFieldDataMultiValue

    • Constructor Detail

      • RequestFieldDataMultiValue

        public RequestFieldDataMultiValue​(@Nonnull
                                          RequestFieldDataMultiValue aRF)
        Copy constructor
        Parameters:
        aRF - The request field to copy the values from. May not be null.
      • RequestFieldDataMultiValue

        public RequestFieldDataMultiValue​(@Nonnull @Nonempty
                                          String sFieldName)
        Create a new request field that has no default value
        Parameters:
        sFieldName - The field name to use. May neither be null nor empty.
      • RequestFieldDataMultiValue

        public RequestFieldDataMultiValue​(@Nonnull @Nonempty
                                          String sFieldName,
                                          @Nullable
                                          Collection<String> aDefaultValues)
        Default constructor.
        Parameters:
        sFieldName - The field name to use. May neither be null nor empty.
        aDefaultValues - The default values to use, if no value is present in the request scope.
    • Method Detail

      • getDefaultValues

        @Nonnull
        @ReturnsMutableCopy
        @OverrideOnDemand
        public com.helger.commons.collection.impl.ICommonsList<String> getDefaultValues()
        Returns:
        The default values to be used if no request parameter is present. Is never null but an empty list if no default value is available.
      • getRequestValuesWithoutDefault

        @Nullable
        protected final com.helger.commons.collection.impl.ICommonsList<String> getRequestValuesWithoutDefault()
        Helper method to get the request value without falling back to the provided default value.
        Returns:
        null if no such request value is present
      • getRequestValues

        @Nonnull
        public final com.helger.commons.collection.impl.ICommonsList<String> getRequestValues()
        Get the value of the request - optionally falling back to the provided default value if no such request parameter is present
        Returns:
        A single request value as string.
      • hasRequestValues

        public final boolean hasRequestValues​(@Nonnull
                                              Collection<String> aExpectedValues)
        Utility method that checks if the passed expected value matches the request parameter (considering the fallback mechanism)
        Parameters:
        aExpectedValues - The list of expected values. May not be null.
        Returns:
        true if the passed value equals the actual request value