Package com.spotify.github.v3.git
Class ImmutableAuthor
- java.lang.Object
-
- com.spotify.github.v3.git.ImmutableAuthor
-
- All Implemented Interfaces:
Author
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableAuthor extends Object implements Author
Immutable implementation ofAuthor
.Use the builder to create immutable instances:
ImmutableAuthor.builder()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmutableAuthor.Builder
Builds instances of typeImmutableAuthor
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableAuthor.Builder
builder()
Creates a builder forImmutableAuthor
.static ImmutableAuthor
copyOf(Author instance)
Creates an immutable copy of aAuthor
value.Optional<GitHubInstant>
date()
Date when action occurred.Optional<String>
email()
The email of the author.boolean
equals(Object another)
This instance is equal to all instances ofImmutableAuthor
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:name
,email
,username
,date
.String
name()
The name of the author.String
toString()
Prints the immutable valueAuthor
with attribute values.Optional<String>
username()
The username of the author, not always set.ImmutableAuthor
withDate(GitHubInstant value)
Copy the current immutable object by setting a present value for the optionaldate
attribute.ImmutableAuthor
withDate(Optional<? extends GitHubInstant> optional)
Copy the current immutable object by setting an optional value for thedate
attribute.ImmutableAuthor
withEmail(String value)
Copy the current immutable object by setting a present value for the optionalemail
attribute.ImmutableAuthor
withEmail(Optional<String> optional)
Copy the current immutable object by setting an optional value for theemail
attribute.ImmutableAuthor
withName(String value)
Copy the current immutable object by setting a value for thename
attribute.ImmutableAuthor
withUsername(String value)
Copy the current immutable object by setting a present value for the optionalusername
attribute.ImmutableAuthor
withUsername(Optional<String> optional)
Copy the current immutable object by setting an optional value for theusername
attribute.
-
-
-
Method Detail
-
date
public Optional<GitHubInstant> date()
Date when action occurred.
-
withName
public final ImmutableAuthor withName(@Nullable String value)
Copy the current immutable object by setting a value for thename
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for name (can benull
)- Returns:
- A modified copy of the
this
object
-
withEmail
public final ImmutableAuthor withEmail(String value)
Copy the current immutable object by setting a present value for the optionalemail
attribute.- Parameters:
value
- The value for email- Returns:
- A modified copy of
this
object
-
withEmail
public final ImmutableAuthor withEmail(Optional<String> optional)
Copy the current immutable object by setting an optional value for theemail
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for email- Returns:
- A modified copy of
this
object
-
withUsername
public final ImmutableAuthor withUsername(String value)
Copy the current immutable object by setting a present value for the optionalusername
attribute.- Parameters:
value
- The value for username- Returns:
- A modified copy of
this
object
-
withUsername
public final ImmutableAuthor withUsername(Optional<String> optional)
Copy the current immutable object by setting an optional value for theusername
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for username- Returns:
- A modified copy of
this
object
-
withDate
public final ImmutableAuthor withDate(GitHubInstant value)
Copy the current immutable object by setting a present value for the optionaldate
attribute.- Parameters:
value
- The value for date- Returns:
- A modified copy of
this
object
-
withDate
public final ImmutableAuthor withDate(Optional<? extends GitHubInstant> optional)
Copy the current immutable object by setting an optional value for thedate
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 date- Returns:
- A modified copy of
this
object
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableAuthor
that have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:name
,email
,username
,date
.
-
toString
public String toString()
Prints the immutable valueAuthor
with attribute values.
-
copyOf
public static ImmutableAuthor copyOf(Author instance)
Creates an immutable copy of aAuthor
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 Author instance
-
builder
public static ImmutableAuthor.Builder builder()
Creates a builder forImmutableAuthor
.ImmutableAuthor.builder() .name(String | null) // nullable
name
.email(String) // optionalemail
.username(String) // optionalusername
.date(com.spotify.github.GitHubInstant) // optionaldate
.build();- Returns:
- A new ImmutableAuthor builder
-
-