Package com.spotify.github.v3.issues
Class ImmutableEvent
- java.lang.Object
-
- com.spotify.github.v3.issues.ImmutableEvent
-
- All Implemented Interfaces:
Event
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableEvent extends Object implements Event
Immutable implementation ofEvent.Use the builder to create immutable instances:
ImmutableEvent.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableEvent.BuilderBuilds instances of typeImmutableEvent.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Useractor()The User object that generated the event.static ImmutableEvent.Builderbuilder()Creates a builder forImmutableEvent.StringcommitId()The String SHA of a commit that referenced this Issue.URIcommitUrl()The GitHub API link to a commit that referenced this Issue.static ImmutableEventcopyOf(Event instance)Creates an immutable copy of aEventvalue.GitHubInstantcreatedAt()The timestamp indicating when the event occurred.booleanequals(Object another)This instance is equal to all instances ofImmutableEventthat have equal attribute values.Stringevent()Identifies the actual type of Event that occurred.inthashCode()Computes a hash code from attributes:id,url,actor,event,commitId,commitUrl,createdAt,issue.Integerid()The Integer ID of the event.Optional<Issue>issue()Issue.StringtoString()Prints the immutable valueEventwith attribute values.URIurl()The API URL for fetching the event.ImmutableEventwithActor(User value)Copy the current immutable object by setting a value for theactorattribute.ImmutableEventwithCommitId(String value)Copy the current immutable object by setting a value for thecommitIdattribute.ImmutableEventwithCommitUrl(URI value)Copy the current immutable object by setting a value for thecommitUrlattribute.ImmutableEventwithCreatedAt(GitHubInstant value)Copy the current immutable object by setting a value for thecreatedAtattribute.ImmutableEventwithEvent(String value)Copy the current immutable object by setting a value for theeventattribute.ImmutableEventwithId(Integer value)Copy the current immutable object by setting a value for theidattribute.ImmutableEventwithIssue(Issue value)Copy the current immutable object by setting a present value for the optionalissueattribute.ImmutableEventwithIssue(Optional<? extends Issue> optional)Copy the current immutable object by setting an optional value for theissueattribute.ImmutableEventwithUrl(URI value)Copy the current immutable object by setting a value for theurlattribute.
-
-
-
Method Detail
-
url
@Nullable public URI url()
The API URL for fetching the event.
-
actor
@Nullable public User actor()
The User object that generated the event.
-
event
@Nullable public String event()
Identifies the actual type of Event that occurred.
-
commitId
@Nullable public String commitId()
The String SHA of a commit that referenced this Issue.
-
commitUrl
@Nullable public URI commitUrl()
The GitHub API link to a commit that referenced this Issue.
-
createdAt
@Nullable public GitHubInstant createdAt()
The timestamp indicating when the event occurred.
-
withId
public final ImmutableEvent withId(@Nullable Integer value)
Copy the current immutable object by setting a value for theidattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for id (can benull)- Returns:
- A modified copy of the
thisobject
-
withUrl
public final ImmutableEvent withUrl(@Nullable URI value)
Copy the current immutable object by setting a value for theurlattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for url (can benull)- Returns:
- A modified copy of the
thisobject
-
withActor
public final ImmutableEvent withActor(@Nullable User value)
Copy the current immutable object by setting a value for theactorattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for actor (can benull)- Returns:
- A modified copy of the
thisobject
-
withEvent
public final ImmutableEvent withEvent(@Nullable String value)
Copy the current immutable object by setting a value for theeventattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for event (can benull)- Returns:
- A modified copy of the
thisobject
-
withCommitId
public final ImmutableEvent withCommitId(@Nullable String value)
Copy the current immutable object by setting a value for thecommitIdattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for commitId (can benull)- Returns:
- A modified copy of the
thisobject
-
withCommitUrl
public final ImmutableEvent withCommitUrl(@Nullable URI value)
Copy the current immutable object by setting a value for thecommitUrlattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for commitUrl (can benull)- Returns:
- A modified copy of the
thisobject
-
withCreatedAt
public final ImmutableEvent withCreatedAt(@Nullable GitHubInstant value)
Copy the current immutable object by setting a value for thecreatedAtattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for createdAt (can benull)- Returns:
- A modified copy of the
thisobject
-
withIssue
public final ImmutableEvent withIssue(Issue value)
Copy the current immutable object by setting a present value for the optionalissueattribute.- Parameters:
value- The value for issue- Returns:
- A modified copy of
thisobject
-
withIssue
public final ImmutableEvent withIssue(Optional<? extends Issue> optional)
Copy the current immutable object by setting an optional value for theissueattribute. 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 issue- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableEventthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:id,url,actor,event,commitId,commitUrl,createdAt,issue.
-
toString
public String toString()
Prints the immutable valueEventwith attribute values.
-
copyOf
public static ImmutableEvent copyOf(Event instance)
Creates an immutable copy of aEventvalue. 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 Event instance
-
builder
public static ImmutableEvent.Builder builder()
Creates a builder forImmutableEvent.ImmutableEvent.builder() .id(Integer | null) // nullableid.url(java.net.URI | null) // nullableurl.actor(com.spotify.github.v3.User | null) // nullableactor.event(String | null) // nullableevent.commitId(String | null) // nullablecommitId.commitUrl(java.net.URI | null) // nullablecommitUrl.createdAt(com.spotify.github.GitHubInstant | null) // nullablecreatedAt.issue(com.spotify.github.v3.issues.Issue) // optionalissue.build();- Returns:
- A new ImmutableEvent builder
-
-