Class ImmutableFileCreate
- java.lang.Object
-
- com.spotify.github.v3.repos.requests.ImmutableFileCreate
-
- All Implemented Interfaces:
FileCreate
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableFileCreate extends Object implements FileCreate
Immutable implementation ofFileCreate.Use the builder to create immutable instances:
ImmutableFileCreate.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableFileCreate.BuilderBuilds instances of typeImmutableFileCreate.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringbranch()The branch name.static ImmutableFileCreate.Builderbuilder()Creates a builder forImmutableFileCreate.Stringcontent()The new file content, using Base64 encodingstatic ImmutableFileCreatecopyOf(FileCreate instance)Creates an immutable copy of aFileCreatevalue.booleanequals(Object another)This instance is equal to all instances ofImmutableFileCreatethat have equal attribute values.inthashCode()Computes a hash code from attributes:message,content,branch.Stringmessage()The commit messageStringtoString()Prints the immutable valueFileCreatewith attribute values.ImmutableFileCreatewithBranch(String value)Copy the current immutable object by setting a value for thebranchattribute.ImmutableFileCreatewithContent(String value)Copy the current immutable object by setting a value for thecontentattribute.ImmutableFileCreatewithMessage(String value)Copy the current immutable object by setting a value for themessageattribute.
-
-
-
Method Detail
-
message
public String message()
The commit message- Specified by:
messagein interfaceFileCreate
-
content
public String content()
The new file content, using Base64 encoding- Specified by:
contentin interfaceFileCreate
-
branch
@Nullable public String branch()
The branch name. Default: the repository’s default branch- Specified by:
branchin interfaceFileCreate
-
withMessage
public final ImmutableFileCreate 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 ImmutableFileCreate 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
-
withBranch
public final ImmutableFileCreate 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 ofImmutableFileCreatethat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:message,content,branch.
-
toString
public String toString()
Prints the immutable valueFileCreatewith attribute values.
-
copyOf
public static ImmutableFileCreate copyOf(FileCreate instance)
Creates an immutable copy of aFileCreatevalue. 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 FileCreate instance
-
builder
public static ImmutableFileCreate.Builder builder()
Creates a builder forImmutableFileCreate.ImmutableFileCreate.builder() .message(String) // requiredmessage.content(String) // requiredcontent.branch(String | null) // nullablebranch.build();- Returns:
- A new ImmutableFileCreate builder
-
-