Interface IFilterableFileTypes<T extends IFilterableFileTypes<T>>
- All Known Implementing Classes:
AttachmentUpload.Builder, OptionData
public interface IFilterableFileTypes<T extends IFilterableFileTypes<T>>
Enables configuring a file type filter.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe number of file type filters that can be applied at once. -
Method Summary
Modifier and TypeMethodDescriptiondefault TaddFileTypeExtensions(String... extensions) default TaddFileTypeExtensions(Collection<String> extensions) addFileTypes(Collection<FileType> fileTypes) default TaddFileTypes(FileType... fileTypes) default TsetFileTypeExtensions(String... extensions) default TsetFileTypeExtensions(Collection<String> extensions) setFileTypes(Collection<FileType> fileTypes) default TsetFileTypes(FileType... fileTypes)
-
Field Details
-
MAX_FILE_TYPES
static final int MAX_FILE_TYPESThe number of file type filters that can be applied at once.- See Also:
-
-
Method Details
-
addFileTypes
- Parameters:
fileTypes- The file types, up to 10<T extends IFilterableFileTypes<T>>- Returns:
- This instance for chaining
- Throws:
IllegalArgumentException- Ifnullis provided, or there are more than 10<T extends IFilterableFileTypes<T>> file types
-
addFileTypes
- Parameters:
fileTypes- The file types, up to 10<T extends IFilterableFileTypes<T>>- Returns:
- This instance for chaining
- Throws:
IllegalArgumentException- Ifnullis provided, or there are more than 10<T extends IFilterableFileTypes<T>> file types
-
addFileTypeExtensions
Adds up to 10<T extends IFilterableFileTypes<T>> file extensions to filter for.This is the same as
addFileTypes(Collection)withFileType.ofExtension(String).- Parameters:
extensions- The extensions, up to 10<T extends IFilterableFileTypes<T>>- Returns:
- This instance for chaining
- Throws:
IllegalArgumentException-- If there are more than 10<T extends IFilterableFileTypes<T>> extensions
- If an extension is
nullor empty - If the extension does not match
[\w\-.]+(latin letters, digits, dashes or dots)
-
addFileTypeExtensions
Adds up to 10<T extends IFilterableFileTypes<T>> file extensions to filter for.This is the same as
addFileTypes(Collection)withFileType.ofExtension(String).- Parameters:
extensions- The extensions, up to 10<T extends IFilterableFileTypes<T>>- Returns:
- This instance for chaining
- Throws:
IllegalArgumentException-- If there are more than 10<T extends IFilterableFileTypes<T>> extensions
- If an extension is
nullor empty - If the extension does not match
[\w\-.]+(latin letters, digits, dashes or dots)
-
setFileTypes
Sets up to 10<T extends IFilterableFileTypes<T>> file types to filter for. Pass an empty collection to remove file type filtering.- Parameters:
fileTypes- The file types, up to 10<T extends IFilterableFileTypes<T>>- Returns:
- This instance for chaining
- Throws:
IllegalArgumentException- Ifnullis provided, or there are more than 10<T extends IFilterableFileTypes<T>> file types
-
setFileTypes
Sets up to 10<T extends IFilterableFileTypes<T>> file types to filter for. Leave the arguments empty to remove file type filtering.- Parameters:
fileTypes- The file types, up to 10<T extends IFilterableFileTypes<T>>- Returns:
- This instance for chaining
- Throws:
IllegalArgumentException- Ifnullis provided, or there are more than 10<T extends IFilterableFileTypes<T>> file types
-
setFileTypeExtensions
Sets up to 10<T extends IFilterableFileTypes<T>> file extensions to filter for. Pass an empty collection to remove file type filtering.This is the same as
addFileTypes(Collection)withFileType.ofExtension(String).- Parameters:
extensions- The extensions, up to 10<T extends IFilterableFileTypes<T>>- Returns:
- This instance for chaining
- Throws:
IllegalArgumentException-- If there are more than 10<T extends IFilterableFileTypes<T>> extensions
- If an extension is
nullor empty - If the extension does not match
[\w\-.]+(latin letters, digits, dashes or dots)
-
setFileTypeExtensions
Sets up to 10<T extends IFilterableFileTypes<T>> file extensions to filter for. Leave the arguments empty to remove file type filtering.This is the same as
addFileTypes(Collection)withFileType.ofExtension(String).- Parameters:
extensions- The extensions, up to 10<T extends IFilterableFileTypes<T>>- Returns:
- This instance for chaining
- Throws:
IllegalArgumentException-- If there are more than 10<T extends IFilterableFileTypes<T>> extensions
- If an extension is
nullor empty - If the extension does not match
[\w\-.]+(latin letters, digits, dashes or dots)
-