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 class
ImmutableFile.Builder
Builds instances of typeImmutableFile
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Integer
additions()
Number of added linesOptional<URI>
blobUrl()
Blob file content API URLstatic ImmutableFile.Builder
builder()
Creates a builder forImmutableFile
.Integer
changes()
Numnber of changed linesOptional<URI>
contentsUrl()
File content API URLstatic ImmutableFile
copyOf(File instance)
Creates an immutable copy of aFile
value.Integer
deletions()
Number of removed linesboolean
equals(Object another)
This instance is equal to all instances ofImmutableFile
that have equal attribute values.String
filename()
File nameint
hashCode()
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 fileString
status()
File status.String
toString()
Prints the immutable valueFile
with attribute values.ImmutableFile
withAdditions(Integer value)
Copy the current immutable object by setting a value for theadditions
attribute.ImmutableFile
withBlobUrl(URI value)
Copy the current immutable object by setting a present value for the optionalblobUrl
attribute.ImmutableFile
withBlobUrl(Optional<? extends URI> optional)
Copy the current immutable object by setting an optional value for theblobUrl
attribute.ImmutableFile
withChanges(Integer value)
Copy the current immutable object by setting a value for thechanges
attribute.ImmutableFile
withContentsUrl(URI value)
Copy the current immutable object by setting a present value for the optionalcontentsUrl
attribute.ImmutableFile
withContentsUrl(Optional<? extends URI> optional)
Copy the current immutable object by setting an optional value for thecontentsUrl
attribute.ImmutableFile
withDeletions(Integer value)
Copy the current immutable object by setting a value for thedeletions
attribute.ImmutableFile
withFilename(String value)
Copy the current immutable object by setting a value for thefilename
attribute.ImmutableFile
withPatch(String value)
Copy the current immutable object by setting a present value for the optionalpatch
attribute.ImmutableFile
withPatch(Optional<String> optional)
Copy the current immutable object by setting an optional value for thepatch
attribute.ImmutableFile
withRawUrl(URI value)
Copy the current immutable object by setting a present value for the optionalrawUrl
attribute.ImmutableFile
withRawUrl(Optional<? extends URI> optional)
Copy the current immutable object by setting an optional value for therawUrl
attribute.ImmutableFile
withSha(String value)
Copy the current immutable object by setting a present value for the optionalsha
attribute.ImmutableFile
withSha(Optional<String> optional)
Copy the current immutable object by setting an optional value for thesha
attribute.ImmutableFile
withStatus(String value)
Copy the current immutable object by setting a value for thestatus
attribute.
-
-
-
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:
contentsUrl
in interfaceFile
-
withFilename
public final ImmutableFile withFilename(@Nullable String value)
Copy the current immutable object by setting a value for thefilename
attribute. 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
this
object
-
withAdditions
public final ImmutableFile withAdditions(@Nullable Integer value)
Copy the current immutable object by setting a value for theadditions
attribute. 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
this
object
-
withDeletions
public final ImmutableFile withDeletions(@Nullable Integer value)
Copy the current immutable object by setting a value for thedeletions
attribute. 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
this
object
-
withChanges
public final ImmutableFile withChanges(@Nullable Integer value)
Copy the current immutable object by setting a value for thechanges
attribute. 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
this
object
-
withStatus
public final ImmutableFile withStatus(@Nullable String value)
Copy the current immutable object by setting a value for thestatus
attribute. 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
this
object
-
withRawUrl
public final ImmutableFile withRawUrl(URI value)
Copy the current immutable object by setting a present value for the optionalrawUrl
attribute.- Parameters:
value
- The value for rawUrl- Returns:
- A modified copy of
this
object
-
withRawUrl
public final ImmutableFile withRawUrl(Optional<? extends URI> optional)
Copy the current immutable object by setting an optional value for therawUrl
attribute. 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
this
object
-
withBlobUrl
public final ImmutableFile withBlobUrl(URI value)
Copy the current immutable object by setting a present value for the optionalblobUrl
attribute.- Parameters:
value
- The value for blobUrl- Returns:
- A modified copy of
this
object
-
withBlobUrl
public final ImmutableFile withBlobUrl(Optional<? extends URI> optional)
Copy the current immutable object by setting an optional value for theblobUrl
attribute. 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
this
object
-
withPatch
public final ImmutableFile withPatch(String value)
Copy the current immutable object by setting a present value for the optionalpatch
attribute.- Parameters:
value
- The value for patch- Returns:
- A modified copy of
this
object
-
withPatch
public final ImmutableFile withPatch(Optional<String> optional)
Copy the current immutable object by setting an optional value for thepatch
attribute. 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
this
object
-
withSha
public final ImmutableFile withSha(String value)
Copy the current immutable object by setting a present value for the optionalsha
attribute.- Parameters:
value
- The value for sha- Returns:
- A modified copy of
this
object
-
withSha
public final ImmutableFile withSha(Optional<String> optional)
Copy the current immutable object by setting an optional value for thesha
attribute. 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
this
object
-
withContentsUrl
public final ImmutableFile withContentsUrl(URI value)
Copy the current immutable object by setting a present value for the optionalcontentsUrl
attribute.- Parameters:
value
- The value for contentsUrl- Returns:
- A modified copy of
this
object
-
withContentsUrl
public final ImmutableFile withContentsUrl(Optional<? extends URI> optional)
Copy the current immutable object by setting an optional value for thecontentsUrl
attribute. 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
this
object
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableFile
that 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 valueFile
with attribute values.
-
copyOf
public static ImmutableFile copyOf(File instance)
Creates an immutable copy of aFile
value. 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) // nullable
filename
.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
-
-