Package de.xima.fc.workflow
Class FileListDescriptor
- java.lang.Object
-
- de.xima.fc.workflow.FileListDescriptor
-
- All Implemented Interfaces:
IFileListDescriptor,IAttributeConfigurable<IFileListDescriptor>,Serializable
public final class FileListDescriptor extends Object implements IFileListDescriptor
Basic POJO implementation ofIFileListDescriptorwith a builder.- Since:
- 8.2.0
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFileListDescriptor.BuilderBuilder forFileListDescriptor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static IFileListDescriptorany()Returns anIFileListDescriptorthat allows any file type and any number of files.static IFileListDescriptoranyFileListDescriptor()Returns anIFileListDescriptorthat allows any file type and any number of files.IFileListBuilderbuilder()Creates a new builder for configuring a file list conforming to this descriptor.static IFileListDescriptorempty()Returns an emptyIFileListDescriptorthat does not allow any files.static FileListDescriptor.BuilderfileListDescriptorBuilder()Creates a new builder forFileListDescriptor.Map<String,Object>getAttributes()Gets a map of additional custom attributes associated with this file list.Set<String>getContentTypes()The content types of the files that might be contained in the list of files.Set<String>getExtensions()The file extensions of the files that can be contained in the list of files.intgetMaxFileCount()The maximum number of files that will be contained in the list of files.intgetMinFileCount()The minimum number of files that are contained in the list of files. 0 when the list might be empty, 1 if the list will contain at least one file.IFileListDescriptorintersect(IFileListDescriptor other)Intersects this file list descriptor with another file list descriptor.StringtoString()IFileListDescriptorwithAddedAttribute(String key, Object value)Gets a new instance with the attribute at the given key changed to the given value.IFileListDescriptorwithAddedAttributes(Map<String,Object> newAttributes)Gets a new instance with the attributes changed to the given map of attributes.IFileListDescriptorwithAttributes(Map<String,Object> attributes)Gets a new instance with the attributes changed to the given map of attributes.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface de.xima.fc.interfaces.workflow.value.IAttributeConfigurable
getAttribute, getAttribute, getBooleanAttribute, getBooleanAttribute, getFloatAttribute, getFloatAttribute, getIntegerAttribute, getIntegerAttribute, getStringAttribute, getStringAttribute
-
Methods inherited from interface de.xima.fc.interfaces.workflow.execution.IFileListDescriptor
allowsAnyFiles, getDescription, isDescriptionHtml, isDescriptionI18nKey
-
-
-
-
Method Detail
-
builder
public IFileListBuilder builder()
Description copied from interface:IFileListDescriptorCreates a new builder for configuring a file list conforming to this descriptor.- Specified by:
builderin interfaceIFileListDescriptor- Returns:
- A new builder for configuring a file list conforming to this descriptor.
-
getAttributes
public Map<String,Object> getAttributes()
Description copied from interface:IFileListDescriptorGets a map of additional custom attributes associated with this file list. The exact meaning of these attributes is up to the user of the file value descriptor API.See
StandardValueDescriptorAttributesfor some standard attribute keys.- Specified by:
getAttributesin interfaceIAttributeConfigurable<IFileListDescriptor>- Specified by:
getAttributesin interfaceIFileListDescriptor- Returns:
- A map of additional attributes associated with the file list.
- See Also:
StandardValueDescriptorAttributes
-
getContentTypes
public Set<String> getContentTypes()
Description copied from interface:IFileListDescriptorThe content types of the files that might be contained in the list of files. Each content type is a MIME type. Use "*/*" when the content type is unknown or any type of file might be contained in the list. Use an asterisk as a wildcard to allow a range of content types, e.g. "image/*". An empty set allows no files.null is treated as if the empty set had been returned.
- Specified by:
getContentTypesin interfaceIFileListDescriptor- Returns:
- The content types of the files that might be contained in the list of files.
-
getExtensions
public Set<String> getExtensions()
Description copied from interface:IFileListDescriptorThe file extensions of the files that can be contained in the list of files. Each extension is a string without a leading dot, e.g. "pdf" or "png". Use the empty string "" to allow files without an extension. Use a set with a single entry "*" when the extension is unknown or any extension is allowed. An empty set allows no files.Implementations should normalize extensions to lower case, so that this method always returns lower case extensions.
null is treated as if the empty set had been returned.
- Specified by:
getExtensionsin interfaceIFileListDescriptor- Returns:
- The file extensions of the files that can be contained in the list of files.
-
getMaxFileCount
public int getMaxFileCount()
Description copied from interface:IFileListDescriptorThe maximum number of files that will be contained in the list of files.MAX_VALUEwhen there is no limit.- Specified by:
getMaxFileCountin interfaceIFileListDescriptor- Returns:
- The maximum number of files that will be contained in the list of files.
-
getMinFileCount
public int getMinFileCount()
Description copied from interface:IFileListDescriptorThe minimum number of files that are contained in the list of files. 0 when the list might be empty, 1 if the list will contain at least one file.- Specified by:
getMinFileCountin interfaceIFileListDescriptor- Returns:
- The minimum number of files that are contained in the list of files.
-
intersect
public IFileListDescriptor intersect(IFileListDescriptor other)
Description copied from interface:IFileListDescriptorIntersects this file list descriptor with another file list descriptor. The intersection of two file list descriptors is a new file list descriptor that only allows files that are allowed by both file list descriptors. When the two file list descriptors are incompatible, returns anemptydescriptor.This operation is, for the most part, symmetric / commutative. The only exception is the
attribute mapof thefiles. When both input descriptors have an attribute with the same key but different values, the value from the right hand side is used.- Specified by:
intersectin interfaceIFileListDescriptor- Parameters:
other- The other file list descriptor to intersect with.- Returns:
- The intersection of this file list descriptor with the other file list descriptor.
-
withAddedAttribute
public IFileListDescriptor withAddedAttribute(String key, Object value)
Description copied from interface:IAttributeConfigurableGets a new instance with the attribute at the given key changed to the given value.- Specified by:
withAddedAttributein interfaceIAttributeConfigurable<IFileListDescriptor>- Parameters:
key- The attribute key.value- The attribute value.- Returns:
- A new instance with the new attribute.
-
withAddedAttributes
public IFileListDescriptor withAddedAttributes(Map<String,Object> newAttributes)
Description copied from interface:IAttributeConfigurableGets a new instance with the attributes changed to the given map of attributes. Preserves other existing attributes and only adds or replaces the given ones.- Specified by:
withAddedAttributesin interfaceIAttributeConfigurable<IFileListDescriptor>- Parameters:
newAttributes- The new attributes to add (or replace).- Returns:
- A new instance with the current attributes plus the given attributes.
-
withAttributes
public IFileListDescriptor withAttributes(Map<String,Object> attributes)
Description copied from interface:IAttributeConfigurableGets a new instance with the attributes changed to the given map of attributes. Replaces all existing attributes.- Specified by:
withAttributesin interfaceIAttributeConfigurable<IFileListDescriptor>- Parameters:
attributes- The new attributes.- Returns:
- A new instance with the given attributes.
-
any
public static IFileListDescriptor any()
Returns anIFileListDescriptorthat allows any file type and any number of files.- Returns:
- A descriptor that allows any file type and any number of files.
-
anyFileListDescriptor
public static IFileListDescriptor anyFileListDescriptor()
Returns anIFileListDescriptorthat allows any file type and any number of files.- Returns:
- A descriptor that allows any file type and any number of files.
-
empty
public static IFileListDescriptor empty()
Returns an emptyIFileListDescriptorthat does not allow any files.- Returns:
- An empty descriptor that does not allow any files.
-
fileListDescriptorBuilder
public static FileListDescriptor.Builder fileListDescriptorBuilder()
Creates a new builder forFileListDescriptor.- Returns:
- A new builder for a file list descriptor.
-
-