Package com.spotify.github.v3.git
Class ImmutableFileItem.Builder
- java.lang.Object
-
- com.spotify.github.v3.git.ImmutableFileItem.Builder
-
- Enclosing class:
- ImmutableFileItem
@NotThreadSafe public static final class ImmutableFileItem.Builder extends Object
Builds instances of typeImmutableFileItem
. Initialize attributes and then invoke thebuild()
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableFileItem.Builder
additions(Integer additions)
Initializes the value for theadditions
attribute.ImmutableFileItem.Builder
blobUrl(URI blobUrl)
Initializes the value for theblobUrl
attribute.ImmutableFileItem
build()
Builds a newImmutableFileItem
.ImmutableFileItem.Builder
changes(Integer changes)
Initializes the value for thechanges
attribute.ImmutableFileItem.Builder
contentsUrl(URI contentsUrl)
Initializes the value for thecontentsUrl
attribute.ImmutableFileItem.Builder
deletions(Integer deletions)
Initializes the value for thedeletions
attribute.ImmutableFileItem.Builder
filename(String filename)
Initializes the value for thefilename
attribute.ImmutableFileItem.Builder
from(FileItem instance)
Fill a builder with attribute values from the providedFileItem
instance.ImmutableFileItem.Builder
patch(String patch)
Initializes the value for thepatch
attribute.ImmutableFileItem.Builder
rawUrl(URI rawUrl)
Initializes the value for therawUrl
attribute.ImmutableFileItem.Builder
sha(String sha)
Initializes the value for thesha
attribute.ImmutableFileItem.Builder
status(String status)
Initializes the value for thestatus
attribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableFileItem.Builder from(FileItem instance)
Fill a builder with attribute values from the providedFileItem
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
-
sha
@CanIgnoreReturnValue public final ImmutableFileItem.Builder sha(String sha)
Initializes the value for thesha
attribute.- Parameters:
sha
- The value for sha- Returns:
this
builder for use in a chained invocation
-
filename
@CanIgnoreReturnValue public final ImmutableFileItem.Builder filename(String filename)
Initializes the value for thefilename
attribute.- Parameters:
filename
- The value for filename- Returns:
this
builder for use in a chained invocation
-
status
@CanIgnoreReturnValue public final ImmutableFileItem.Builder status(@Nullable String status)
Initializes the value for thestatus
attribute.- Parameters:
status
- The value for status (can benull
)- Returns:
this
builder for use in a chained invocation
-
additions
@CanIgnoreReturnValue public final ImmutableFileItem.Builder additions(@Nullable Integer additions)
Initializes the value for theadditions
attribute.- Parameters:
additions
- The value for additions (can benull
)- Returns:
this
builder for use in a chained invocation
-
deletions
@CanIgnoreReturnValue public final ImmutableFileItem.Builder deletions(@Nullable Integer deletions)
Initializes the value for thedeletions
attribute.- Parameters:
deletions
- The value for deletions (can benull
)- Returns:
this
builder for use in a chained invocation
-
changes
@CanIgnoreReturnValue public final ImmutableFileItem.Builder changes(@Nullable Integer changes)
Initializes the value for thechanges
attribute.- Parameters:
changes
- The value for changes (can benull
)- Returns:
this
builder for use in a chained invocation
-
blobUrl
@CanIgnoreReturnValue public final ImmutableFileItem.Builder blobUrl(@Nullable URI blobUrl)
Initializes the value for theblobUrl
attribute.- Parameters:
blobUrl
- The value for blobUrl (can benull
)- Returns:
this
builder for use in a chained invocation
-
rawUrl
@CanIgnoreReturnValue public final ImmutableFileItem.Builder rawUrl(@Nullable URI rawUrl)
Initializes the value for therawUrl
attribute.- Parameters:
rawUrl
- The value for rawUrl (can benull
)- Returns:
this
builder for use in a chained invocation
-
contentsUrl
@CanIgnoreReturnValue public final ImmutableFileItem.Builder contentsUrl(@Nullable URI contentsUrl)
Initializes the value for thecontentsUrl
attribute.- Parameters:
contentsUrl
- The value for contentsUrl (can benull
)- Returns:
this
builder for use in a chained invocation
-
patch
@CanIgnoreReturnValue public final ImmutableFileItem.Builder patch(@Nullable String patch)
Initializes the value for thepatch
attribute.- Parameters:
patch
- The value for patch (can benull
)- Returns:
this
builder for use in a chained invocation
-
build
public ImmutableFileItem build()
Builds a newImmutableFileItem
.- Returns:
- An immutable instance of FileItem
- Throws:
IllegalStateException
- if any required attributes are missing
-
-