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.Builderis 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.Builderadditions(Integer additions)Initializes the value for theadditionsattribute.ImmutableFileItem.BuilderblobUrl(URI blobUrl)Initializes the value for theblobUrlattribute.ImmutableFileItembuild()Builds a newImmutableFileItem.ImmutableFileItem.Builderchanges(Integer changes)Initializes the value for thechangesattribute.ImmutableFileItem.BuildercontentsUrl(URI contentsUrl)Initializes the value for thecontentsUrlattribute.ImmutableFileItem.Builderdeletions(Integer deletions)Initializes the value for thedeletionsattribute.ImmutableFileItem.Builderfilename(String filename)Initializes the value for thefilenameattribute.ImmutableFileItem.Builderfrom(FileItem instance)Fill a builder with attribute values from the providedFileIteminstance.ImmutableFileItem.Builderpatch(String patch)Initializes the value for thepatchattribute.ImmutableFileItem.BuilderrawUrl(URI rawUrl)Initializes the value for therawUrlattribute.ImmutableFileItem.Buildersha(String sha)Initializes the value for theshaattribute.ImmutableFileItem.Builderstatus(String status)Initializes the value for thestatusattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableFileItem.Builder from(FileItem instance)
Fill a builder with attribute values from the providedFileIteminstance. 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:
thisbuilder for use in a chained invocation
-
sha
@CanIgnoreReturnValue public final ImmutableFileItem.Builder sha(String sha)
Initializes the value for theshaattribute.- Parameters:
sha- The value for sha- Returns:
thisbuilder for use in a chained invocation
-
filename
@CanIgnoreReturnValue public final ImmutableFileItem.Builder filename(String filename)
Initializes the value for thefilenameattribute.- Parameters:
filename- The value for filename- Returns:
thisbuilder for use in a chained invocation
-
status
@CanIgnoreReturnValue public final ImmutableFileItem.Builder status(@Nullable String status)
Initializes the value for thestatusattribute.- Parameters:
status- The value for status (can benull)- Returns:
thisbuilder for use in a chained invocation
-
additions
@CanIgnoreReturnValue public final ImmutableFileItem.Builder additions(@Nullable Integer additions)
Initializes the value for theadditionsattribute.- Parameters:
additions- The value for additions (can benull)- Returns:
thisbuilder for use in a chained invocation
-
deletions
@CanIgnoreReturnValue public final ImmutableFileItem.Builder deletions(@Nullable Integer deletions)
Initializes the value for thedeletionsattribute.- Parameters:
deletions- The value for deletions (can benull)- Returns:
thisbuilder for use in a chained invocation
-
changes
@CanIgnoreReturnValue public final ImmutableFileItem.Builder changes(@Nullable Integer changes)
Initializes the value for thechangesattribute.- Parameters:
changes- The value for changes (can benull)- Returns:
thisbuilder for use in a chained invocation
-
blobUrl
@CanIgnoreReturnValue public final ImmutableFileItem.Builder blobUrl(@Nullable URI blobUrl)
Initializes the value for theblobUrlattribute.- Parameters:
blobUrl- The value for blobUrl (can benull)- Returns:
thisbuilder for use in a chained invocation
-
rawUrl
@CanIgnoreReturnValue public final ImmutableFileItem.Builder rawUrl(@Nullable URI rawUrl)
Initializes the value for therawUrlattribute.- Parameters:
rawUrl- The value for rawUrl (can benull)- Returns:
thisbuilder for use in a chained invocation
-
contentsUrl
@CanIgnoreReturnValue public final ImmutableFileItem.Builder contentsUrl(@Nullable URI contentsUrl)
Initializes the value for thecontentsUrlattribute.- Parameters:
contentsUrl- The value for contentsUrl (can benull)- Returns:
thisbuilder for use in a chained invocation
-
patch
@CanIgnoreReturnValue public final ImmutableFileItem.Builder patch(@Nullable String patch)
Initializes the value for thepatchattribute.- Parameters:
patch- The value for patch (can benull)- Returns:
thisbuilder 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
-
-