Package com.spotify.github.v3.repos
Class ImmutableFile.Builder
- java.lang.Object
-
- com.spotify.github.v3.repos.ImmutableFile.Builder
-
- Enclosing class:
- ImmutableFile
@NotThreadSafe public static final class ImmutableFile.Builder extends Object
Builds instances of typeImmutableFile
. 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 ImmutableFile.Builder
additions(Integer additions)
Initializes the value for theadditions
attribute.ImmutableFile.Builder
blobUrl(URI blobUrl)
Initializes the optional valueblobUrl
to blobUrl.ImmutableFile.Builder
blobUrl(Optional<? extends URI> blobUrl)
Initializes the optional valueblobUrl
to blobUrl.ImmutableFile
build()
Builds a newImmutableFile
.ImmutableFile.Builder
changes(Integer changes)
Initializes the value for thechanges
attribute.ImmutableFile.Builder
contentsUrl(URI contentsUrl)
Initializes the optional valuecontentsUrl
to contentsUrl.ImmutableFile.Builder
contentsUrl(Optional<? extends URI> contentsUrl)
Initializes the optional valuecontentsUrl
to contentsUrl.ImmutableFile.Builder
deletions(Integer deletions)
Initializes the value for thedeletions
attribute.ImmutableFile.Builder
filename(String filename)
Initializes the value for thefilename
attribute.ImmutableFile.Builder
from(File instance)
Fill a builder with attribute values from the providedFile
instance.ImmutableFile.Builder
patch(String patch)
Initializes the optional valuepatch
to patch.ImmutableFile.Builder
patch(Optional<String> patch)
Initializes the optional valuepatch
to patch.ImmutableFile.Builder
rawUrl(URI rawUrl)
Initializes the optional valuerawUrl
to rawUrl.ImmutableFile.Builder
rawUrl(Optional<? extends URI> rawUrl)
Initializes the optional valuerawUrl
to rawUrl.ImmutableFile.Builder
sha(String sha)
Initializes the optional valuesha
to sha.ImmutableFile.Builder
sha(Optional<String> sha)
Initializes the optional valuesha
to sha.ImmutableFile.Builder
status(String status)
Initializes the value for thestatus
attribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableFile.Builder from(File instance)
Fill a builder with attribute values from the providedFile
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
-
filename
@CanIgnoreReturnValue public final ImmutableFile.Builder filename(@Nullable String filename)
Initializes the value for thefilename
attribute.- Parameters:
filename
- The value for filename (can benull
)- Returns:
this
builder for use in a chained invocation
-
additions
@CanIgnoreReturnValue public final ImmutableFile.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 ImmutableFile.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 ImmutableFile.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
-
status
@CanIgnoreReturnValue public final ImmutableFile.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
-
rawUrl
@CanIgnoreReturnValue public final ImmutableFile.Builder rawUrl(URI rawUrl)
Initializes the optional valuerawUrl
to rawUrl.- Parameters:
rawUrl
- The value for rawUrl- Returns:
this
builder for chained invocation
-
rawUrl
@CanIgnoreReturnValue public final ImmutableFile.Builder rawUrl(Optional<? extends URI> rawUrl)
Initializes the optional valuerawUrl
to rawUrl.- Parameters:
rawUrl
- The value for rawUrl- Returns:
this
builder for use in a chained invocation
-
blobUrl
@CanIgnoreReturnValue public final ImmutableFile.Builder blobUrl(URI blobUrl)
Initializes the optional valueblobUrl
to blobUrl.- Parameters:
blobUrl
- The value for blobUrl- Returns:
this
builder for chained invocation
-
blobUrl
@CanIgnoreReturnValue public final ImmutableFile.Builder blobUrl(Optional<? extends URI> blobUrl)
Initializes the optional valueblobUrl
to blobUrl.- Parameters:
blobUrl
- The value for blobUrl- Returns:
this
builder for use in a chained invocation
-
patch
@CanIgnoreReturnValue public final ImmutableFile.Builder patch(String patch)
Initializes the optional valuepatch
to patch.- Parameters:
patch
- The value for patch- Returns:
this
builder for chained invocation
-
patch
@CanIgnoreReturnValue public final ImmutableFile.Builder patch(Optional<String> patch)
Initializes the optional valuepatch
to patch.- Parameters:
patch
- The value for patch- Returns:
this
builder for use in a chained invocation
-
sha
@CanIgnoreReturnValue public final ImmutableFile.Builder sha(String sha)
Initializes the optional valuesha
to sha.- Parameters:
sha
- The value for sha- Returns:
this
builder for chained invocation
-
sha
@CanIgnoreReturnValue public final ImmutableFile.Builder sha(Optional<String> sha)
Initializes the optional valuesha
to sha.- Parameters:
sha
- The value for sha- Returns:
this
builder for use in a chained invocation
-
contentsUrl
@CanIgnoreReturnValue public final ImmutableFile.Builder contentsUrl(URI contentsUrl)
Initializes the optional valuecontentsUrl
to contentsUrl.- Parameters:
contentsUrl
- The value for contentsUrl- Returns:
this
builder for chained invocation
-
contentsUrl
@CanIgnoreReturnValue public final ImmutableFile.Builder contentsUrl(Optional<? extends URI> contentsUrl)
Initializes the optional valuecontentsUrl
to contentsUrl.- Parameters:
contentsUrl
- The value for contentsUrl- Returns:
this
builder for use in a chained invocation
-
build
public ImmutableFile build()
Builds a newImmutableFile
.- Returns:
- An immutable instance of File
- Throws:
IllegalStateException
- if any required attributes are missing
-
-