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 class
ImmutableEvent.Builder
Builds instances of typeImmutableEvent
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description User
actor()
The User object that generated the event.static ImmutableEvent.Builder
builder()
Creates a builder forImmutableEvent
.String
commitId()
The String SHA of a commit that referenced this Issue.URI
commitUrl()
The GitHub API link to a commit that referenced this Issue.static ImmutableEvent
copyOf(Event instance)
Creates an immutable copy of aEvent
value.GitHubInstant
createdAt()
The timestamp indicating when the event occurred.boolean
equals(Object another)
This instance is equal to all instances ofImmutableEvent
that have equal attribute values.String
event()
Identifies the actual type of Event that occurred.int
hashCode()
Computes a hash code from attributes:id
,url
,actor
,event
,commitId
,commitUrl
,createdAt
,issue
.Integer
id()
The Integer ID of the event.Optional<Issue>
issue()
Issue.String
toString()
Prints the immutable valueEvent
with attribute values.URI
url()
The API URL for fetching the event.ImmutableEvent
withActor(User value)
Copy the current immutable object by setting a value for theactor
attribute.ImmutableEvent
withCommitId(String value)
Copy the current immutable object by setting a value for thecommitId
attribute.ImmutableEvent
withCommitUrl(URI value)
Copy the current immutable object by setting a value for thecommitUrl
attribute.ImmutableEvent
withCreatedAt(GitHubInstant value)
Copy the current immutable object by setting a value for thecreatedAt
attribute.ImmutableEvent
withEvent(String value)
Copy the current immutable object by setting a value for theevent
attribute.ImmutableEvent
withId(Integer value)
Copy the current immutable object by setting a value for theid
attribute.ImmutableEvent
withIssue(Issue value)
Copy the current immutable object by setting a present value for the optionalissue
attribute.ImmutableEvent
withIssue(Optional<? extends Issue> optional)
Copy the current immutable object by setting an optional value for theissue
attribute.ImmutableEvent
withUrl(URI value)
Copy the current immutable object by setting a value for theurl
attribute.
-
-
-
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 theid
attribute. 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
this
object
-
withUrl
public final ImmutableEvent withUrl(@Nullable URI value)
Copy the current immutable object by setting a value for theurl
attribute. 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
this
object
-
withActor
public final ImmutableEvent withActor(@Nullable User value)
Copy the current immutable object by setting a value for theactor
attribute. 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
this
object
-
withEvent
public final ImmutableEvent withEvent(@Nullable String value)
Copy the current immutable object by setting a value for theevent
attribute. 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
this
object
-
withCommitId
public final ImmutableEvent withCommitId(@Nullable String value)
Copy the current immutable object by setting a value for thecommitId
attribute. 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
this
object
-
withCommitUrl
public final ImmutableEvent withCommitUrl(@Nullable URI value)
Copy the current immutable object by setting a value for thecommitUrl
attribute. 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
this
object
-
withCreatedAt
public final ImmutableEvent withCreatedAt(@Nullable GitHubInstant value)
Copy the current immutable object by setting a value for thecreatedAt
attribute. 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
this
object
-
withIssue
public final ImmutableEvent withIssue(Issue value)
Copy the current immutable object by setting a present value for the optionalissue
attribute.- Parameters:
value
- The value for issue- Returns:
- A modified copy of
this
object
-
withIssue
public final ImmutableEvent withIssue(Optional<? extends Issue> optional)
Copy the current immutable object by setting an optional value for theissue
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 issue- Returns:
- A modified copy of
this
object
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableEvent
that 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 valueEvent
with attribute values.
-
copyOf
public static ImmutableEvent copyOf(Event instance)
Creates an immutable copy of aEvent
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 Event instance
-
builder
public static ImmutableEvent.Builder builder()
Creates a builder forImmutableEvent
.ImmutableEvent.builder() .id(Integer | null) // nullable
id
.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
-
-