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 classImmutableAuthor.BuilderBuilds instances of typeImmutableAuthor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableAuthor.Builderbuilder()Creates a builder forImmutableAuthor.static ImmutableAuthorcopyOf(Author instance)Creates an immutable copy of aAuthorvalue.Optional<GitHubInstant>date()Date when action occurred.Optional<String>email()The email of the author.booleanequals(Object another)This instance is equal to all instances ofImmutableAuthorthat have equal attribute values.inthashCode()Computes a hash code from attributes:name,email,username,date.Stringname()The name of the author.StringtoString()Prints the immutable valueAuthorwith attribute values.Optional<String>username()The username of the author, not always set.ImmutableAuthorwithDate(GitHubInstant value)Copy the current immutable object by setting a present value for the optionaldateattribute.ImmutableAuthorwithDate(Optional<? extends GitHubInstant> optional)Copy the current immutable object by setting an optional value for thedateattribute.ImmutableAuthorwithEmail(String value)Copy the current immutable object by setting a present value for the optionalemailattribute.ImmutableAuthorwithEmail(Optional<String> optional)Copy the current immutable object by setting an optional value for theemailattribute.ImmutableAuthorwithName(String value)Copy the current immutable object by setting a value for thenameattribute.ImmutableAuthorwithUsername(String value)Copy the current immutable object by setting a present value for the optionalusernameattribute.ImmutableAuthorwithUsername(Optional<String> optional)Copy the current immutable object by setting an optional value for theusernameattribute.
-
-
-
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 thenameattribute. 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
thisobject
-
withEmail
public final ImmutableAuthor withEmail(String value)
Copy the current immutable object by setting a present value for the optionalemailattribute.- Parameters:
value- The value for email- Returns:
- A modified copy of
thisobject
-
withEmail
public final ImmutableAuthor withEmail(Optional<String> optional)
Copy the current immutable object by setting an optional value for theemailattribute. 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
thisobject
-
withUsername
public final ImmutableAuthor withUsername(String value)
Copy the current immutable object by setting a present value for the optionalusernameattribute.- Parameters:
value- The value for username- Returns:
- A modified copy of
thisobject
-
withUsername
public final ImmutableAuthor withUsername(Optional<String> optional)
Copy the current immutable object by setting an optional value for theusernameattribute. 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
thisobject
-
withDate
public final ImmutableAuthor withDate(GitHubInstant value)
Copy the current immutable object by setting a present value for the optionaldateattribute.- Parameters:
value- The value for date- Returns:
- A modified copy of
thisobject
-
withDate
public final ImmutableAuthor withDate(Optional<? extends GitHubInstant> optional)
Copy the current immutable object by setting an optional value for thedateattribute. 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
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableAuthorthat 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 valueAuthorwith attribute values.
-
copyOf
public static ImmutableAuthor copyOf(Author instance)
Creates an immutable copy of aAuthorvalue. 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) // nullablename.email(String) // optionalemail.username(String) // optionalusername.date(com.spotify.github.GitHubInstant) // optionaldate.build();- Returns:
- A new ImmutableAuthor builder
-
-