Package com.spotify.github.v3.git
Class ImmutableFileItem
- java.lang.Object
-
- com.spotify.github.v3.git.ImmutableFileItem
-
- All Implemented Interfaces:
FileItem
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableFileItem extends Object implements FileItem
Immutable implementation ofFileItem.Use the builder to create immutable instances:
ImmutableFileItem.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableFileItem.BuilderBuilds instances of typeImmutableFileItem.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Integeradditions()URIblobUrl()static ImmutableFileItem.Builderbuilder()Creates a builder forImmutableFileItem.Integerchanges()URIcontentsUrl()static ImmutableFileItemcopyOf(FileItem instance)Creates an immutable copy of aFileItemvalue.Integerdeletions()Author commit user.booleanequals(Object another)This instance is equal to all instances ofImmutableFileItemthat have equal attribute values.Stringfilename()Commit node_id.inthashCode()Computes a hash code from attributes:sha,filename,status,additions,deletions,changes,blobUrl,rawUrl,contentsUrl,patch.Stringpatch()URIrawUrl()Stringsha()Commit sha value.Stringstatus()Commit API URL.StringtoString()Prints the immutable valueFileItemwith attribute values.ImmutableFileItemwithAdditions(Integer value)Copy the current immutable object by setting a value for theadditionsattribute.ImmutableFileItemwithBlobUrl(URI value)Copy the current immutable object by setting a value for theblobUrlattribute.ImmutableFileItemwithChanges(Integer value)Copy the current immutable object by setting a value for thechangesattribute.ImmutableFileItemwithContentsUrl(URI value)Copy the current immutable object by setting a value for thecontentsUrlattribute.ImmutableFileItemwithDeletions(Integer value)Copy the current immutable object by setting a value for thedeletionsattribute.ImmutableFileItemwithFilename(String value)Copy the current immutable object by setting a value for thefilenameattribute.ImmutableFileItemwithPatch(String value)Copy the current immutable object by setting a value for thepatchattribute.ImmutableFileItemwithRawUrl(URI value)Copy the current immutable object by setting a value for therawUrlattribute.ImmutableFileItemwithSha(String value)Copy the current immutable object by setting a value for theshaattribute.ImmutableFileItemwithStatus(String value)Copy the current immutable object by setting a value for thestatusattribute.
-
-
-
Method Detail
-
additions
@Nullable public Integer additions()
-
deletions
@Nullable public Integer deletions()
Author commit user.
-
changes
@Nullable public Integer changes()
-
blobUrl
@Nullable public URI blobUrl()
-
rawUrl
@Nullable public URI rawUrl()
-
contentsUrl
@Nullable public URI contentsUrl()
- Specified by:
contentsUrlin interfaceFileItem- Returns:
- The value of the
contentsUrlattribute
-
patch
@Nullable public String patch()
-
withSha
public final ImmutableFileItem withSha(String value)
Copy the current immutable object by setting a value for theshaattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for sha- Returns:
- A modified copy of the
thisobject
-
withFilename
public final ImmutableFileItem withFilename(String value)
Copy the current immutable object by setting a value for thefilenameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for filename- Returns:
- A modified copy of the
thisobject
-
withStatus
public final ImmutableFileItem withStatus(@Nullable String value)
Copy the current immutable object by setting a value for thestatusattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for status (can benull)- Returns:
- A modified copy of the
thisobject
-
withAdditions
public final ImmutableFileItem withAdditions(@Nullable Integer value)
Copy the current immutable object by setting a value for theadditionsattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for additions (can benull)- Returns:
- A modified copy of the
thisobject
-
withDeletions
public final ImmutableFileItem withDeletions(@Nullable Integer value)
Copy the current immutable object by setting a value for thedeletionsattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for deletions (can benull)- Returns:
- A modified copy of the
thisobject
-
withChanges
public final ImmutableFileItem withChanges(@Nullable Integer value)
Copy the current immutable object by setting a value for thechangesattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for changes (can benull)- Returns:
- A modified copy of the
thisobject
-
withBlobUrl
public final ImmutableFileItem withBlobUrl(@Nullable URI value)
Copy the current immutable object by setting a value for theblobUrlattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for blobUrl (can benull)- Returns:
- A modified copy of the
thisobject
-
withRawUrl
public final ImmutableFileItem withRawUrl(@Nullable URI value)
Copy the current immutable object by setting a value for therawUrlattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for rawUrl (can benull)- Returns:
- A modified copy of the
thisobject
-
withContentsUrl
public final ImmutableFileItem withContentsUrl(@Nullable URI value)
Copy the current immutable object by setting a value for thecontentsUrlattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for contentsUrl (can benull)- Returns:
- A modified copy of the
thisobject
-
withPatch
public final ImmutableFileItem withPatch(@Nullable String value)
Copy the current immutable object by setting a value for thepatchattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for patch (can benull)- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableFileItemthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:sha,filename,status,additions,deletions,changes,blobUrl,rawUrl,contentsUrl,patch.
-
toString
public String toString()
Prints the immutable valueFileItemwith attribute values.
-
copyOf
public static ImmutableFileItem copyOf(FileItem instance)
Creates an immutable copy of aFileItemvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable FileItem instance
-
builder
public static ImmutableFileItem.Builder builder()
Creates a builder forImmutableFileItem.ImmutableFileItem.builder() .sha(String) // requiredsha.filename(String) // requiredfilename.status(String | null) // nullablestatus.additions(Integer | null) // nullableadditions.deletions(Integer | null) // nullabledeletions.changes(Integer | null) // nullablechanges.blobUrl(java.net.URI | null) // nullableblobUrl.rawUrl(java.net.URI | null) // nullablerawUrl.contentsUrl(java.net.URI | null) // nullablecontentsUrl.patch(String | null) // nullablepatch.build();- Returns:
- A new ImmutableFileItem builder
-
-