Package com.io7m.jwheatsheaf.ui.internal
Class JWFileItem.Builder
java.lang.Object
com.io7m.jwheatsheaf.ui.internal.JWFileItem.Builder
- Enclosing class:
- JWFileItem
Builds instances of type
JWFileItem
.
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 newJWFileItem
.final JWFileItem.Builder
from
(JWFileItemType instance) Fill a builder with attribute values from the providedJWFileItemType
instance.final JWFileItem.Builder
setDisplayName
(String displayName) Initializes the optional valuedisplayName
to displayName.final JWFileItem.Builder
setDisplayName
(Optional<String> displayName) Initializes the optional valuedisplayName
to displayName.final JWFileItem.Builder
setKind
(JWFileKind kind) Initializes the value for thekind
attribute.final JWFileItem.Builder
setModifiedTime
(FileTime modifiedTime) Initializes the value for themodifiedTime
attribute.final JWFileItem.Builder
Initializes the value for thepath
attribute.final JWFileItem.Builder
setSize
(long size) Initializes the value for thesize
attribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedJWFileItemType
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
-
setKind
Initializes the value for thekind
attribute.- Parameters:
kind
- The value for kind- Returns:
this
builder for use in a chained invocation
-
setPath
Initializes the value for thepath
attribute.- Parameters:
path
- The value for path- Returns:
this
builder for use in a chained invocation
-
setSize
Initializes the value for thesize
attribute.- Parameters:
size
- The value for size- Returns:
this
builder for use in a chained invocation
-
setModifiedTime
Initializes the value for themodifiedTime
attribute.- Parameters:
modifiedTime
- The value for modifiedTime- Returns:
this
builder for use in a chained invocation
-
setDisplayName
Initializes the optional valuedisplayName
to displayName.- Parameters:
displayName
- The value for displayName- Returns:
this
builder for chained invocation
-
setDisplayName
Initializes the optional valuedisplayName
to displayName.- Parameters:
displayName
- The value for displayName- Returns:
this
builder for use in a chained invocation
-
build
Builds a newJWFileItem
.- Returns:
- An immutable instance of JWFileItem
- Throws:
IllegalStateException
- if any required attributes are missing
-