Interface IRequestParamContainer

  • All Superinterfaces:
    com.helger.commons.collection.attr.IAttributeContainer<String,​Object>, com.helger.commons.collection.attr.IAttributeContainerAny<String>, com.helger.commons.lang.ICloneable<com.helger.commons.collection.impl.ICommonsMap<String,​Object>>, com.helger.commons.collection.impl.ICommonsMap<String,​Object>, com.helger.commons.traits.IGetterByKeyTrait<String>, Map<String,​Object>
    All Known Implementing Classes:
    RequestWebScope.ParamContainer

    public interface IRequestParamContainer
    extends com.helger.commons.collection.attr.IAttributeContainerAny<String>
    A special request parameter container with support for file items etc. By default only String and String[] entries are present. If the request was parsed as a multipart request, it may also container IFileItem or IFileItem[] entries.
    Author:
    Philip Helger
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface com.helger.commons.collection.attr.IAttributeContainer

        com.helger.commons.collection.attr.IAttributeContainer.IAfterSetValueCallback<KEYTYPE extends Object,​VALUETYPE extends Object>, com.helger.commons.collection.attr.IAttributeContainer.IBeforeSetValueCallback<KEYTYPE extends Object,​VALUETYPE extends Object>
    • Method Summary

      All Methods Instance Methods Default Methods 
      Modifier and Type Method Description
      default com.helger.commons.collection.impl.ICommonsMap<String,​IFileItem> getAllUploadedFileItems()  
      default com.helger.commons.collection.impl.ICommonsMap<String,​IFileItem[]> getAllUploadedFileItemsComplete()  
      default com.helger.commons.collection.impl.ICommonsList<IFileItem> getAllUploadedFileItemValues()  
      default IFileItem getAsFileItem​(String sAttrName)
      Get the request attribute denoted by the specified attribute name as an uploaded file item.
      default String getAsStringTrimmed​(String sFieldName)
      Same as getAsString but with a trimmed return value.
      default String getAsStringTrimmed​(String sFieldName, String sDefault)
      Same as getAsString but with a trimmed return value.
      default boolean hasCheckBoxValue​(String sFieldName, String sFieldValue, boolean bDefaultValue)  
      default boolean isCheckBoxChecked​(String sFieldName, boolean bDefaultValue)
      Get the value of the checkbox of the request parameter with the given name.
      • Methods inherited from interface com.helger.commons.collection.attr.IAttributeContainer

        afterSetValueCallbacks, beforeSetValueCallbacks, getAsBoolean, getAsDouble, getAsFloat, getAsInt, getAsLong, getValue, putAllIn, putIn
      • Methods inherited from interface com.helger.commons.collection.attr.IAttributeContainerAny

        getAndSetFlag, getClone, putIn, putIn, putIn, putIn, putIn, putIn
      • Methods inherited from interface com.helger.commons.collection.impl.ICommonsMap

        addAll, containsAnyEntry, containsAnyKey, containsAnyValue, copyOfEntrySet, copyOfKeySet, copyOfKeySet, copyOfValues, copyOfValues, copyOfValuesMapped, copyOfValuesMapped, createInstance, findFirstEntry, findFirstKey, findFirstValue, forEach, forEachKey, forEachKey, forEachValue, forEachValue, getAsUnmodifiable, getFirstEntry, getFirstEntry, getFirstKey, getFirstKey, getFirstValue, getFirstValue, getSortedByKey, getSortedByValue, getSwappedKeyValues, isNotEmpty, put, putAll, putAll, putAllMapped, putAllMapped, putAllMapped, putIf, putIfNotNull, removeAll, removeIf, removeIfKey, removeIfValue, removeObject, setAll
      • Methods inherited from interface com.helger.commons.traits.IGetterByKeyTrait

        containsNonNullValue, containsNullValue, getAsBigDecimal, getAsBigDecimal, getAsBigInteger, getAsBigInteger, getAsBoolean, getAsBooleanObj, getAsByte, getAsByte, getAsByteArray, getAsByteObj, getAsChar, getAsChar, getAsCharArray, getAsCharArray, getAsCharObj, getAsDouble, getAsDoubleObj, getAsFloat, getAsFloatObj, getAsInt, getAsIntObj, getAsLocalDate, getAsLocalDate, getAsLocalDate, getAsLocalDateTime, getAsLocalDateTime, getAsLocalDateTime, getAsLocalTime, getAsLocalTime, getAsLocalTime, getAsLong, getAsLongObj, getAsShort, getAsShort, getAsShortObj, getAsSqlBlob, getAsSqlClob, getAsSqlDate, getAsSqlNClob, getAsSqlRowId, getAsSqlTime, getAsSqlTimestamp, getAsString, getAsString, getAsStringList, getAsStringList, getAsStringSet, getAsStringSet, getCastedValue, getCastedValue, getCastedValue, getCastedValue, getConvertedValue, getConvertedValue, getSafeCastedValue, getSafeCastedValue, getValueClass, hasStringValue, hasStringValue, onSafeCastError
    • Method Detail

      • getAllUploadedFileItems

        @Nonnull
        default com.helger.commons.collection.impl.ICommonsMap<String,​IFileItem> getAllUploadedFileItems()
        Returns:
        A non-null but maybe empty map with all contained IFileItem objects from file uploads. The key of the map is the field name. Important: if the value is an array of IFileItem it is not considered in the returned map!
      • getAllUploadedFileItemsComplete

        @Nonnull
        default com.helger.commons.collection.impl.ICommonsMap<String,​IFileItem[]> getAllUploadedFileItemsComplete()
        Returns:
        A non-null but maybe empty map with all contained IFileItem objects from file uploads. The key of the map is the field name.
      • getAllUploadedFileItemValues

        @Nonnull
        default com.helger.commons.collection.impl.ICommonsList<IFileItem> getAllUploadedFileItemValues()
        Returns:
        A non-null but maybe empty list of all IFileItem objects in the request. In comparison to getAllUploadedFileItems() this method also returns the content of IFileItem arrays.
      • getAsFileItem

        @Nullable
        default IFileItem getAsFileItem​(@Nullable
                                        String sAttrName)
        Get the request attribute denoted by the specified attribute name as an uploaded file item. In case the specified parameter is present but not a file item, the method returns null.
        Parameters:
        sAttrName - The attribute name to resolved. May be null.
        Returns:
        null if no such attribute is present, or if the attribute is not a file item.
      • isCheckBoxChecked

        default boolean isCheckBoxChecked​(@Nullable
                                          String sFieldName,
                                          boolean bDefaultValue)
        Get the value of the checkbox of the request parameter with the given name.
        Parameters:
        sFieldName - Request parameter name. May be null.
        bDefaultValue - the default value to be returned, if no request attribute is present
        Returns:
        true if the checkbox is checked, false if it is not checked and the default value otherwise.
      • hasCheckBoxValue

        default boolean hasCheckBoxValue​(@Nonnull @Nonempty
                                         String sFieldName,
                                         @Nonnull
                                         String sFieldValue,
                                         boolean bDefaultValue)
      • getAsStringTrimmed

        @Nullable
        default String getAsStringTrimmed​(@Nullable
                                          String sFieldName)
        Same as getAsString but with a trimmed return value.
        Parameters:
        sFieldName - The field name to query. May be null.
        Returns:
        null if no such parameter name is present.
        Since:
        9.0.2
      • getAsStringTrimmed

        @Nullable
        default String getAsStringTrimmed​(@Nullable
                                          String sFieldName,
                                          @Nullable
                                          String sDefault)
        Same as getAsString but with a trimmed return value.
        Parameters:
        sFieldName - The field name to query. May be null.
        sDefault - The value to be returned if the retrieved value is null .
        Returns:
        null if no such parameter name is present.
        Since:
        9.0.2