Class DefaultFulfillRequestedUploadRequest.BaseBuilder<Request,Self extends DefaultFulfillRequestedUploadRequest.BaseBuilder<Request,Self>>
- java.lang.Object
-
- de.xima.fc.common.form_record.chat.DefaultFulfillRequestedUploadRequest.BaseBuilder<Request,Self>
-
- Direct Known Subclasses:
DefaultExtendedFulfillRequestedUploadRequest.Builder
,DefaultFulfillRequestedUploadRequest.Builder
- Enclosing class:
- DefaultFulfillRequestedUploadRequest
public abstract static class DefaultFulfillRequestedUploadRequest.BaseBuilder<Request,Self extends DefaultFulfillRequestedUploadRequest.BaseBuilder<Request,Self>> extends Object
Builder for the data needed to fulfill a pending upload request.- Since:
- 8.2.0
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
BaseBuilder(UUID uploadRequestUuid)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Self
addFile(ISerializableFile file)
Adds a file to the list of files to use for fulfilling the upload request.Self
attachmentSource(EAttachmentSource attachmentSource)
Sets the source of the attachments to create.abstract Request
build()
Creates the data needed to fulfill a pending upload request.protected IFulfillRequestedUploadRequest
buildBaseRequest()
Self
enforceChat(UUID chatUuid)
When given, enforces that theDefaultFulfillRequestedUploadRequest.uploadRequestUuid()
matches the given chat UUID, i.e.Self
enforceExplicitContentType()
Self
enforceExplicitContentType(boolean enforceExplicitContentType)
Self
enforceMatchingUser()
Enforces that the user fulfilling the request matches one of the chat members.Self
enforceMatchingUser(boolean enforceMatchingUser)
Sets whether to enforce that the user fulfilling the request matches one of the chat members.Self
enforceMessage(UUID messageUuid)
When given, enforces that theDefaultFulfillRequestedUploadRequest.uploadRequestUuid()
matches the given message UUID, i.e.Self
files(ISerializableFile... files)
Sets the files to use for fulfilling the upload request.Self
files(List<ISerializableFile> files)
Sets the files to use for fulfilling the upload request.Self
initializeResponse()
Initializes all fields in the response entities.Self
initializeResponse(boolean initializeResponse)
Sets whether to initialize all fields in the response entities.Self
makeFilesAccessibleToEndUser()
Makes the newly created attachments accessible to the end user.Self
makeFilesAccessibleToEndUser(boolean makeFilesAccessibleToEndUser)
Sets whether to make the newly created attachments accessible to the end user.Self
oathKeeper(IUser oathKeeper)
Sets the user who kept the oath by providing uploads to fulfill the request.protected abstract Self
self()
-
-
-
Constructor Detail
-
BaseBuilder
protected BaseBuilder(UUID uploadRequestUuid)
-
-
Method Detail
-
addFile
@CanIgnoreReturnValue public Self addFile(ISerializableFile file)
Adds a file to the list of files to use for fulfilling the upload request.- Parameters:
file
- The file to add to the list of files to use for fulfilling the upload request.- Returns:
- This builder for chaining method calls.
-
attachmentSource
@CanIgnoreReturnValue public Self attachmentSource(EAttachmentSource attachmentSource)
Sets the source of the attachments to create. Applies only when the upload request does not reference an upload element (in which case the source is always set toFORM_UPLOAD
). Defaults toUNKNOWN
.- Parameters:
attachmentSource
- The source of the attachments to create.- Returns:
- This builder for chaining method calls.
-
build
public abstract Request build()
Creates the data needed to fulfill a pending upload request. Any modifications to the builder will not affect the built request.- Returns:
- The data needed to fulfill a pending upload request.
-
enforceChat
@CanIgnoreReturnValue public Self enforceChat(UUID chatUuid)
When given, enforces that theDefaultFulfillRequestedUploadRequest.uploadRequestUuid()
matches the given chat UUID, i.e. that the chat contains the upload request.- Parameters:
chatUuid
- The UUID of the message to enforce.- Returns:
- This builder for chaining method calls.
-
enforceExplicitContentType
@CanIgnoreReturnValue public Self enforceExplicitContentType()
-
enforceExplicitContentType
@CanIgnoreReturnValue public Self enforceExplicitContentType(boolean enforceExplicitContentType)
-
enforceMatchingUser
@CanIgnoreReturnValue public Self enforceMatchingUser()
Enforces that the user fulfilling the request matches one of the chat members.- Returns:
- This builder for chaining method calls.
-
enforceMatchingUser
@CanIgnoreReturnValue public Self enforceMatchingUser(boolean enforceMatchingUser)
Sets whether to enforce that the user fulfilling the request matches one of the chat members.- Parameters:
enforceMatchingUser
- Whether to enforce that the user fulfilling the request matches one of the chat members.- Returns:
- This builder for chaining method calls.
-
enforceMessage
@CanIgnoreReturnValue public Self enforceMessage(UUID messageUuid)
When given, enforces that theDefaultFulfillRequestedUploadRequest.uploadRequestUuid()
matches the given message UUID, i.e. that the message contains the upload request.- Parameters:
messageUuid
- The UUID of the message to enforce.- Returns:
- This builder for chaining method calls.
-
files
@CanIgnoreReturnValue public Self files(ISerializableFile... files)
Sets the files to use for fulfilling the upload request.- Parameters:
files
- The files to use for fulfilling the upload request.- Returns:
- This builder for chaining method calls.
-
files
@CanIgnoreReturnValue public Self files(List<ISerializableFile> files)
Sets the files to use for fulfilling the upload request.- Parameters:
files
- The files to use for fulfilling the upload request.- Returns:
- This builder for chaining method calls.
-
initializeResponse
@CanIgnoreReturnValue public Self initializeResponse()
Initializes all fields in the response entities. Defaults to false.- Returns:
- This builder for chaining method calls.
-
initializeResponse
@CanIgnoreReturnValue public Self initializeResponse(boolean initializeResponse)
Sets whether to initialize all fields in the response entities. Defaults to false.- Parameters:
initializeResponse
- Whether to initialize all fields in the response entities.- Returns:
- This builder for chaining method calls.
-
makeFilesAccessibleToEndUser
@CanIgnoreReturnValue public Self makeFilesAccessibleToEndUser()
Makes the newly created attachments accessible to the end user. Defaults to false.- Returns:
- This builder for chaining method calls.
-
makeFilesAccessibleToEndUser
@CanIgnoreReturnValue public Self makeFilesAccessibleToEndUser(boolean makeFilesAccessibleToEndUser)
Sets whether to make the newly created attachments accessible to the end user. Defaults to false.- Parameters:
makeFilesAccessibleToEndUser
- Whether to make the newly created attachments accessible to the end user.- Returns:
- This builder for chaining method calls.
-
oathKeeper
@CanIgnoreReturnValue public Self oathKeeper(IUser oathKeeper)
Sets the user who kept the oath by providing uploads to fulfill the request. Optional, but required ifenforceMatchingUser
is set to true.- Parameters:
oathKeeper
- The user who provided the upload to fulfill the request.- Returns:
- This builder for chaining method calls.
-
buildBaseRequest
protected IFulfillRequestedUploadRequest buildBaseRequest()
-
self
protected abstract Self self()
-
-