Package com.spotify.github.v3.repos
Class ImmutableFile
- java.lang.Object
-
- com.spotify.github.v3.repos.ImmutableFile
-
- All Implemented Interfaces:
File
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableFile extends Object implements File
Immutable implementation ofFile.Use the builder to create immutable instances:
ImmutableFile.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableFile.BuilderBuilds instances of typeImmutableFile.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Integeradditions()Number of added linesOptional<URI>blobUrl()Blob file content API URLstatic ImmutableFile.Builderbuilder()Creates a builder forImmutableFile.Integerchanges()Numnber of changed linesOptional<URI>contentsUrl()File content API URLstatic ImmutableFilecopyOf(File instance)Creates an immutable copy of aFilevalue.Integerdeletions()Number of removed linesbooleanequals(Object another)This instance is equal to all instances ofImmutableFilethat have equal attribute values.Stringfilename()File nameinthashCode()Computes a hash code from attributes:filename,additions,deletions,changes,status,rawUrl,blobUrl,patch,sha,contentsUrl.Optional<String>patch()Patch contentOptional<URI>rawUrl()Raw file content API URLOptional<String>sha()Sha that included action taken on the given fileStringstatus()File status.StringtoString()Prints the immutable valueFilewith attribute values.ImmutableFilewithAdditions(Integer value)Copy the current immutable object by setting a value for theadditionsattribute.ImmutableFilewithBlobUrl(URI value)Copy the current immutable object by setting a present value for the optionalblobUrlattribute.ImmutableFilewithBlobUrl(Optional<? extends URI> optional)Copy the current immutable object by setting an optional value for theblobUrlattribute.ImmutableFilewithChanges(Integer value)Copy the current immutable object by setting a value for thechangesattribute.ImmutableFilewithContentsUrl(URI value)Copy the current immutable object by setting a present value for the optionalcontentsUrlattribute.ImmutableFilewithContentsUrl(Optional<? extends URI> optional)Copy the current immutable object by setting an optional value for thecontentsUrlattribute.ImmutableFilewithDeletions(Integer value)Copy the current immutable object by setting a value for thedeletionsattribute.ImmutableFilewithFilename(String value)Copy the current immutable object by setting a value for thefilenameattribute.ImmutableFilewithPatch(String value)Copy the current immutable object by setting a present value for the optionalpatchattribute.ImmutableFilewithPatch(Optional<String> optional)Copy the current immutable object by setting an optional value for thepatchattribute.ImmutableFilewithRawUrl(URI value)Copy the current immutable object by setting a present value for the optionalrawUrlattribute.ImmutableFilewithRawUrl(Optional<? extends URI> optional)Copy the current immutable object by setting an optional value for therawUrlattribute.ImmutableFilewithSha(String value)Copy the current immutable object by setting a present value for the optionalshaattribute.ImmutableFilewithSha(Optional<String> optional)Copy the current immutable object by setting an optional value for theshaattribute.ImmutableFilewithStatus(String value)Copy the current immutable object by setting a value for thestatusattribute.
-
-
-
Method Detail
-
additions
@Nullable public Integer additions()
Number of added lines
-
deletions
@Nullable public Integer deletions()
Number of removed lines
-
changes
@Nullable public Integer changes()
Numnber of changed lines
-
status
@Nullable public String status()
File status. E.g added, modified
-
contentsUrl
public Optional<URI> contentsUrl()
File content API URL- Specified by:
contentsUrlin interfaceFile
-
withFilename
public final ImmutableFile withFilename(@Nullable 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 (can benull)- Returns:
- A modified copy of the
thisobject
-
withAdditions
public final ImmutableFile 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 ImmutableFile 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 ImmutableFile 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
-
withStatus
public final ImmutableFile 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
-
withRawUrl
public final ImmutableFile withRawUrl(URI value)
Copy the current immutable object by setting a present value for the optionalrawUrlattribute.- Parameters:
value- The value for rawUrl- Returns:
- A modified copy of
thisobject
-
withRawUrl
public final ImmutableFile withRawUrl(Optional<? extends URI> optional)
Copy the current immutable object by setting an optional value for therawUrlattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for rawUrl- Returns:
- A modified copy of
thisobject
-
withBlobUrl
public final ImmutableFile withBlobUrl(URI value)
Copy the current immutable object by setting a present value for the optionalblobUrlattribute.- Parameters:
value- The value for blobUrl- Returns:
- A modified copy of
thisobject
-
withBlobUrl
public final ImmutableFile withBlobUrl(Optional<? extends URI> optional)
Copy the current immutable object by setting an optional value for theblobUrlattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for blobUrl- Returns:
- A modified copy of
thisobject
-
withPatch
public final ImmutableFile withPatch(String value)
Copy the current immutable object by setting a present value for the optionalpatchattribute.- Parameters:
value- The value for patch- Returns:
- A modified copy of
thisobject
-
withPatch
public final ImmutableFile withPatch(Optional<String> optional)
Copy the current immutable object by setting an optional value for thepatchattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for patch- Returns:
- A modified copy of
thisobject
-
withSha
public final ImmutableFile withSha(String value)
Copy the current immutable object by setting a present value for the optionalshaattribute.- Parameters:
value- The value for sha- Returns:
- A modified copy of
thisobject
-
withSha
public final ImmutableFile withSha(Optional<String> optional)
Copy the current immutable object by setting an optional value for theshaattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for sha- Returns:
- A modified copy of
thisobject
-
withContentsUrl
public final ImmutableFile withContentsUrl(URI value)
Copy the current immutable object by setting a present value for the optionalcontentsUrlattribute.- Parameters:
value- The value for contentsUrl- Returns:
- A modified copy of
thisobject
-
withContentsUrl
public final ImmutableFile withContentsUrl(Optional<? extends URI> optional)
Copy the current immutable object by setting an optional value for thecontentsUrlattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for contentsUrl- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableFilethat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:filename,additions,deletions,changes,status,rawUrl,blobUrl,patch,sha,contentsUrl.
-
toString
public String toString()
Prints the immutable valueFilewith attribute values.
-
copyOf
public static ImmutableFile copyOf(File instance)
Creates an immutable copy of aFilevalue. 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 File instance
-
builder
public static ImmutableFile.Builder builder()
Creates a builder forImmutableFile.ImmutableFile.builder() .filename(String | null) // nullablefilename.additions(Integer | null) // nullableadditions.deletions(Integer | null) // nullabledeletions.changes(Integer | null) // nullablechanges.status(String | null) // nullablestatus.rawUrl(java.net.URI) // optionalrawUrl.blobUrl(java.net.URI) // optionalblobUrl.patch(String) // optionalpatch.sha(String) // optionalsha.contentsUrl(java.net.URI) // optionalcontentsUrl.build();- Returns:
- A new ImmutableFile builder
-
-