Class FileListDescriptor.Builder

java.lang.Object
de.xima.fc.workflow.FileListDescriptor.Builder
Enclosing class:
FileListDescriptor

public static final class FileListDescriptor.Builder extends Object
Builder for FileListDescriptor.
Since:
8.2.0
  • Method Details

    • addAttribute

      public FileListDescriptor.Builder addAttribute(String name, Object value)
      Adds an attribute to the file list descriptor. If value is null, the attribute is removed.

      See StandardValueDescriptorAttributes for some standard attribute keys and values you can use.

      Parameters:
      name - The name of the attribute.
      value - The value of the attribute.
      Returns:
      This builder for chaining method calls.
      See Also:
    • addAttributes

      public FileListDescriptor.Builder addAttributes(Map<String,Object> attributes)
      Adds all attributes from the given map to the file list descriptor. If attributes is null, nothing is added.

      See StandardValueDescriptorAttributes for some standard attribute keys and values you can use.

      Parameters:
      attributes - The attributes to add.
      Returns:
      This builder for chaining method calls.
      See Also:
    • attributes

      public FileListDescriptor.Builder attributes(Map<String,Object> attributes)
      Sets (replaces) all attributes of the file list descriptor. If attributes is null, all attributes are removed.

      See StandardValueDescriptorAttributes for some standard attribute keys and values you can use.

      Parameters:
      attributes - The new attributes to set.
      Returns:
      This builder for chaining method calls.
      See Also:
    • build

      public FileListDescriptor build()
      Builds a new FileListDescriptor with the data set in this builder. Any modifications to this builder after calling this method will not affect the returned descriptor.
      Returns:
      A new descriptor with the data set in this builder.
    • contentTypes

      public FileListDescriptor.Builder contentTypes(Set<String> contentTypes)
      Adds content types that are allowed for the files. Use a singleton set with "*/*" to allow all content types. Use an asterisk as a wildcard to allow a range of content types, e.g. "image/*". An empty set allows no content types. Defaults to a singleton set with "*/*".
      Parameters:
      contentTypes - The content types that are allowed for the files.
      Returns:
      This builder for chaining method calls.
    • contentTypes

      public FileListDescriptor.Builder contentTypes(String... contentTypes)
      Adds content types that are allowed for the files. Use a singleton set with "*/*" to allow all content types. Use an asterisk as a wildcard to allow a range of content types, e.g. "image/*". An empty set allows no content types. Defaults to a singleton set with "*/*".
      Parameters:
      contentTypes - The content types that are allowed for the files.
      Returns:
      This builder for chaining method calls.
    • description

      @Deprecated public FileListDescriptor.Builder description(String description)
      Sets the I18n key pointing to a description for the file.
      Parameters:
      description - The description for the file. It's interpretation depends on IFileListDescriptor.isDescriptionI18nKey() and IFileListDescriptor.isDescriptionHtml().
      Returns:
      This builder for chaining method calls.
    • descriptionHtml

      @Deprecated public FileListDescriptor.Builder descriptionHtml(boolean descriptionHtml)
      Sets whether the description is an HTML string. When false, the description is treated as plain text. Defaults to false.
      Parameters:
      descriptionHtml - Whether the description is an HTML string.
      Returns:
      This builder for chaining method calls.
    • descriptionI18nKey

      @Deprecated public FileListDescriptor.Builder descriptionI18nKey(boolean descriptionI18nKey)
      Sets whether the description is an I18N key that needs to be looked up in a resource bundle. When false, the description is used as-is. Defaults to true.
      Parameters:
      descriptionI18nKey - Whether the description is an I18N string.
      Returns:
      This builder for chaining method calls.
    • extensions

      public FileListDescriptor.Builder extensions(Set<String> extensions)
      Adds file extensions that are allowed for the files. Use the empty string to allow files without an extension. Use a singleton set with "*" to allow all files. An empty set allows no files. Defaults to a singleton set with "*".
      Parameters:
      extensions - The file extensions that are allowed for the files, without leading dot.
      Returns:
      This builder for chaining method calls.
    • extensions

      public FileListDescriptor.Builder extensions(String... extensions)
      Adds file extensions that are allowed for the files. Use the empty string to allow files without an extension. Use a singleton set with "*" to allow all files. An empty set allows no files. Defaults to a singleton set with "*".
      Parameters:
      extensions - The file extensions that are allowed for the files, without leading dot.
      Returns:
      This builder for chaining method calls.
    • fileCount

      public FileListDescriptor.Builder fileCount(int minFileCount, int maxFileCount)
    • maxFileCount

      public FileListDescriptor.Builder maxFileCount(int maxFileCount)
      Sets the maximum number of files that can be provided.
      Parameters:
      maxFileCount - The maximum number of files that can be provided.
      Returns:
      This builder for chaining method calls.
    • minFileCount

      public FileListDescriptor.Builder minFileCount(int minFileCount)
      Sets the minimum number of files that must be provided.
      Parameters:
      minFileCount - The minimum number of files that must be provided.
      Returns:
      This builder for chaining method calls.