Class ImmutableFileUpdate
- java.lang.Object
-
- com.spotify.github.v3.repos.requests.ImmutableFileUpdate
-
- All Implemented Interfaces:
FileUpdate
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableFileUpdate extends Object implements FileUpdate
Immutable implementation ofFileUpdate
.Use the builder to create immutable instances:
ImmutableFileUpdate.builder()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmutableFileUpdate.Builder
Builds instances of typeImmutableFileUpdate
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
branch()
The branch name.static ImmutableFileUpdate.Builder
builder()
Creates a builder forImmutableFileUpdate
.String
content()
The new file content, using Base64 encodingstatic ImmutableFileUpdate
copyOf(FileUpdate instance)
Creates an immutable copy of aFileUpdate
value.boolean
equals(Object another)
This instance is equal to all instances ofImmutableFileUpdate
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:message
,content
,sha
,branch
.String
message()
The commit messageString
sha()
The SHA of the file being replaced.String
toString()
Prints the immutable valueFileUpdate
with attribute values.ImmutableFileUpdate
withBranch(String value)
Copy the current immutable object by setting a value for thebranch
attribute.ImmutableFileUpdate
withContent(String value)
Copy the current immutable object by setting a value for thecontent
attribute.ImmutableFileUpdate
withMessage(String value)
Copy the current immutable object by setting a value for themessage
attribute.ImmutableFileUpdate
withSha(String value)
Copy the current immutable object by setting a value for thesha
attribute.
-
-
-
Method Detail
-
message
public String message()
The commit message- Specified by:
message
in interfaceFileUpdate
-
content
public String content()
The new file content, using Base64 encoding- Specified by:
content
in interfaceFileUpdate
-
sha
public String sha()
The SHA of the file being replaced.- Specified by:
sha
in interfaceFileUpdate
-
branch
@Nullable public String branch()
The branch name. Default: the repository’s default branch- Specified by:
branch
in interfaceFileUpdate
-
withMessage
public final ImmutableFileUpdate withMessage(String value)
Copy the current immutable object by setting a value for themessage
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for message- Returns:
- A modified copy of the
this
object
-
withContent
public final ImmutableFileUpdate withContent(String value)
Copy the current immutable object by setting a value for thecontent
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for content- Returns:
- A modified copy of the
this
object
-
withSha
public final ImmutableFileUpdate withSha(String value)
Copy the current immutable object by setting a value for thesha
attribute. 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
this
object
-
withBranch
public final ImmutableFileUpdate withBranch(@Nullable String value)
Copy the current immutable object by setting a value for thebranch
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for branch (can benull
)- Returns:
- A modified copy of the
this
object
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableFileUpdate
that have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:message
,content
,sha
,branch
.
-
toString
public String toString()
Prints the immutable valueFileUpdate
with attribute values.
-
copyOf
public static ImmutableFileUpdate copyOf(FileUpdate instance)
Creates an immutable copy of aFileUpdate
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 FileUpdate instance
-
builder
public static ImmutableFileUpdate.Builder builder()
Creates a builder forImmutableFileUpdate
.ImmutableFileUpdate.builder() .message(String) // required
message
.content(String) // requiredcontent
.sha(String) // requiredsha
.branch(String | null) // nullablebranch
.build();- Returns:
- A new ImmutableFileUpdate builder
-
-