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 classImmutableFileUpdate.BuilderBuilds instances of typeImmutableFileUpdate.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringbranch()The branch name.static ImmutableFileUpdate.Builderbuilder()Creates a builder forImmutableFileUpdate.Stringcontent()The new file content, using Base64 encodingstatic ImmutableFileUpdatecopyOf(FileUpdate instance)Creates an immutable copy of aFileUpdatevalue.booleanequals(Object another)This instance is equal to all instances ofImmutableFileUpdatethat have equal attribute values.inthashCode()Computes a hash code from attributes:message,content,sha,branch.Stringmessage()The commit messageStringsha()The SHA of the file being replaced.StringtoString()Prints the immutable valueFileUpdatewith attribute values.ImmutableFileUpdatewithBranch(String value)Copy the current immutable object by setting a value for thebranchattribute.ImmutableFileUpdatewithContent(String value)Copy the current immutable object by setting a value for thecontentattribute.ImmutableFileUpdatewithMessage(String value)Copy the current immutable object by setting a value for themessageattribute.ImmutableFileUpdatewithSha(String value)Copy the current immutable object by setting a value for theshaattribute.
-
-
-
Method Detail
-
message
public String message()
The commit message- Specified by:
messagein interfaceFileUpdate
-
content
public String content()
The new file content, using Base64 encoding- Specified by:
contentin interfaceFileUpdate
-
sha
public String sha()
The SHA of the file being replaced.- Specified by:
shain interfaceFileUpdate
-
branch
@Nullable public String branch()
The branch name. Default: the repository’s default branch- Specified by:
branchin interfaceFileUpdate
-
withMessage
public final ImmutableFileUpdate withMessage(String value)
Copy the current immutable object by setting a value for themessageattribute. 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
thisobject
-
withContent
public final ImmutableFileUpdate withContent(String value)
Copy the current immutable object by setting a value for thecontentattribute. 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
thisobject
-
withSha
public final ImmutableFileUpdate 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
-
withBranch
public final ImmutableFileUpdate withBranch(@Nullable String value)
Copy the current immutable object by setting a value for thebranchattribute. 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
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableFileUpdatethat 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 valueFileUpdatewith attribute values.
-
copyOf
public static ImmutableFileUpdate copyOf(FileUpdate instance)
Creates an immutable copy of aFileUpdatevalue. 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) // requiredmessage.content(String) // requiredcontent.sha(String) // requiredsha.branch(String | null) // nullablebranch.build();- Returns:
- A new ImmutableFileUpdate builder
-
-