Class ImmutableAttachmentBean.Builder
java.lang.Object
com.riadalabs.jira.plugins.insight.services.model.ImmutableAttachmentBean.Builder
- Enclosing class:
- ImmutableAttachmentBean
Builds instances of type
ImmutableAttachmentBean
.
Initialize attributes and then invoke the build()
method to create an
immutable instance.
Builder
is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a newImmutableAttachmentBean
.from
(AttachmentBean instance) Fill a builder with attribute values from the providedAttachmentBean
instance.Initializes the value for theauthor
attribute.setComment
(String comment) Initializes the value for thecomment
attribute.setCreated
(Date created) Initializes the value for thecreated
attribute.setFilename
(String filename) Initializes the value for thefilename
attribute.setFileSize
(Long fileSize) Initializes the value for thefileSize
attribute.Initializes the value for theid
attribute.setMimeType
(String mimeType) Initializes the value for themimeType
attribute.setNameInFileSystem
(String nameInFileSystem) Initializes the value for thenameInFileSystem
attribute.setObjectId
(Integer objectId) Initializes the value for theobjectId
attribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedAttachmentBean
instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
setId
Initializes the value for theid
attribute.- Parameters:
id
- The value for id (can benull
)- Returns:
this
builder for use in a chained invocation
-
setObjectId
Initializes the value for theobjectId
attribute.- Parameters:
objectId
- The value for objectId- Returns:
this
builder for use in a chained invocation
-
setAuthor
Initializes the value for theauthor
attribute.- Parameters:
author
- The value for author- Returns:
this
builder for use in a chained invocation
-
setComment
@CanIgnoreReturnValue public final ImmutableAttachmentBean.Builder setComment(@Nullable String comment) Initializes the value for thecomment
attribute.- Parameters:
comment
- The value for comment (can benull
)- Returns:
this
builder for use in a chained invocation
-
setFilename
Initializes the value for thefilename
attribute.- Parameters:
filename
- The value for filename- Returns:
this
builder for use in a chained invocation
-
setMimeType
Initializes the value for themimeType
attribute.- Parameters:
mimeType
- The value for mimeType- Returns:
this
builder for use in a chained invocation
-
setNameInFileSystem
@CanIgnoreReturnValue public final ImmutableAttachmentBean.Builder setNameInFileSystem(String nameInFileSystem) Initializes the value for thenameInFileSystem
attribute.- Parameters:
nameInFileSystem
- The value for nameInFileSystem- Returns:
this
builder for use in a chained invocation
-
setFileSize
Initializes the value for thefileSize
attribute.- Parameters:
fileSize
- The value for fileSize- Returns:
this
builder for use in a chained invocation
-
setCreated
Initializes the value for thecreated
attribute.- Parameters:
created
- The value for created- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableAttachmentBean
.- Returns:
- An immutable instance of AttachmentBean
- Throws:
IllegalStateException
- if any required attributes are missing
-