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 class
ImmutableFileCreate.Builder
Builds instances of typeImmutableFileCreate
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
branch()
The branch name.static ImmutableFileCreate.Builder
builder()
Creates a builder forImmutableFileCreate
.String
content()
The new file content, using Base64 encodingstatic ImmutableFileCreate
copyOf(FileCreate instance)
Creates an immutable copy of aFileCreate
value.boolean
equals(Object another)
This instance is equal to all instances ofImmutableFileCreate
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:message
,content
,branch
.String
message()
The commit messageString
toString()
Prints the immutable valueFileCreate
with attribute values.ImmutableFileCreate
withBranch(String value)
Copy the current immutable object by setting a value for thebranch
attribute.ImmutableFileCreate
withContent(String value)
Copy the current immutable object by setting a value for thecontent
attribute.ImmutableFileCreate
withMessage(String value)
Copy the current immutable object by setting a value for themessage
attribute.
-
-
-
Method Detail
-
message
public String message()
The commit message- Specified by:
message
in interfaceFileCreate
-
content
public String content()
The new file content, using Base64 encoding- Specified by:
content
in interfaceFileCreate
-
branch
@Nullable public String branch()
The branch name. Default: the repository’s default branch- Specified by:
branch
in interfaceFileCreate
-
withMessage
public final ImmutableFileCreate 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 ImmutableFileCreate 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
-
withBranch
public final ImmutableFileCreate 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 ofImmutableFileCreate
that have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:message
,content
,branch
.
-
toString
public String toString()
Prints the immutable valueFileCreate
with attribute values.
-
copyOf
public static ImmutableFileCreate copyOf(FileCreate instance)
Creates an immutable copy of aFileCreate
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 FileCreate instance
-
builder
public static ImmutableFileCreate.Builder builder()
Creates a builder forImmutableFileCreate
.ImmutableFileCreate.builder() .message(String) // required
message
.content(String) // requiredcontent
.branch(String | null) // nullablebranch
.build();- Returns:
- A new ImmutableFileCreate builder
-
-