Package com.spotify.github.v3.issues
Class ImmutableIssue
- java.lang.Object
-
- com.spotify.github.v3.issues.ImmutableIssue
-
- All Implemented Interfaces:
CloseTracking
,UpdateTracking
,Issue
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableIssue extends Object implements Issue
Immutable implementation ofIssue
.Use the builder to create immutable instances:
ImmutableIssue.builder()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmutableIssue.Builder
Builds instances of typeImmutableIssue
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<User>
assignee()
Login for the user that this issue should be assigned to.Optional<String>
body()
The contents of the issue.static ImmutableIssue.Builder
builder()
Creates a builder forImmutableIssue
.Optional<GitHubInstant>
closedAt()
Closed date.Integer
comments()
Number of comments.URI
commentsUrl()
Comments URL.static ImmutableIssue
copyOf(Issue instance)
Creates an immutable copy of aIssue
value.GitHubInstant
createdAt()
Created dateboolean
equals(Object another)
This instance is equal to all instances ofImmutableIssue
that have equal attribute values.Optional<URI>
eventsUrl()
Events URL.int
hashCode()
Computes a hash code from attributes:createdAt
,updatedAt
,closedAt
,id
,url
,eventsUrl
,repositoryUrl
,labelsUrl
,commentsUrl
,htmlUrl
,number
,state
,title
,body
,user
,labels
,assignee
,milestone
,locked
,comments
,pullRequest
.URI
htmlUrl()
HTML URL.Integer
id()
ID.List<Label>
labels()
A list of comma separated label names.String
labelsUrl()
Labels URL template.Boolean
locked()
Is locked.Optional<Milestone>
milestone()
The milestone associated this issue with.Integer
number()
Number.Optional<PullRequest>
pullRequest()
Pull request.Optional<URI>
repositoryUrl()
Repository URL.String
state()
Indicates the state of the issues to return.String
title()
The title of the issue.String
toString()
Prints the immutable valueIssue
with attribute values.GitHubInstant
updatedAt()
Updated dateURI
url()
URL.User
user()
User.ImmutableIssue
withAssignee(User value)
Copy the current immutable object by setting a present value for the optionalassignee
attribute.ImmutableIssue
withAssignee(Optional<? extends User> optional)
Copy the current immutable object by setting an optional value for theassignee
attribute.ImmutableIssue
withBody(Optional<String> value)
Copy the current immutable object by setting a value for thebody
attribute.ImmutableIssue
withClosedAt(GitHubInstant value)
Copy the current immutable object by setting a present value for the optionalclosedAt
attribute.ImmutableIssue
withClosedAt(Optional<? extends GitHubInstant> optional)
Copy the current immutable object by setting an optional value for theclosedAt
attribute.ImmutableIssue
withComments(Integer value)
Copy the current immutable object by setting a value for thecomments
attribute.ImmutableIssue
withCommentsUrl(URI value)
Copy the current immutable object by setting a value for thecommentsUrl
attribute.ImmutableIssue
withCreatedAt(GitHubInstant value)
Copy the current immutable object by setting a value for thecreatedAt
attribute.ImmutableIssue
withEventsUrl(Optional<URI> value)
Copy the current immutable object by setting a value for theeventsUrl
attribute.ImmutableIssue
withHtmlUrl(URI value)
Copy the current immutable object by setting a value for thehtmlUrl
attribute.ImmutableIssue
withId(Integer value)
Copy the current immutable object by setting a value for theid
attribute.ImmutableIssue
withLabels(Label... elements)
Copy the current immutable object with elements that replace the content oflabels
.ImmutableIssue
withLabels(Iterable<? extends Label> elements)
Copy the current immutable object with elements that replace the content oflabels
.ImmutableIssue
withLabelsUrl(String value)
Copy the current immutable object by setting a value for thelabelsUrl
attribute.ImmutableIssue
withLocked(Boolean value)
Copy the current immutable object by setting a value for thelocked
attribute.ImmutableIssue
withMilestone(Milestone value)
Copy the current immutable object by setting a present value for the optionalmilestone
attribute.ImmutableIssue
withMilestone(Optional<? extends Milestone> optional)
Copy the current immutable object by setting an optional value for themilestone
attribute.ImmutableIssue
withNumber(Integer value)
Copy the current immutable object by setting a value for thenumber
attribute.ImmutableIssue
withPullRequest(PullRequest value)
Copy the current immutable object by setting a present value for the optionalpullRequest
attribute.ImmutableIssue
withPullRequest(Optional<? extends PullRequest> optional)
Copy the current immutable object by setting an optional value for thepullRequest
attribute.ImmutableIssue
withRepositoryUrl(Optional<URI> value)
Copy the current immutable object by setting a value for therepositoryUrl
attribute.ImmutableIssue
withState(String value)
Copy the current immutable object by setting a value for thestate
attribute.ImmutableIssue
withTitle(String value)
Copy the current immutable object by setting a value for thetitle
attribute.ImmutableIssue
withUpdatedAt(GitHubInstant value)
Copy the current immutable object by setting a value for theupdatedAt
attribute.ImmutableIssue
withUrl(URI value)
Copy the current immutable object by setting a value for theurl
attribute.ImmutableIssue
withUser(User value)
Copy the current immutable object by setting a value for theuser
attribute.
-
-
-
Method Detail
-
createdAt
@Nullable public GitHubInstant createdAt()
Created date- Specified by:
createdAt
in interfaceUpdateTracking
- Returns:
- The date when the issue was created
-
updatedAt
@Nullable public GitHubInstant updatedAt()
Updated date- Specified by:
updatedAt
in interfaceUpdateTracking
- Returns:
- The date when the issue was updated
-
closedAt
public Optional<GitHubInstant> closedAt()
Closed date.- Specified by:
closedAt
in interfaceCloseTracking
- Returns:
- The date when the issue was closed
-
repositoryUrl
@Nullable public Optional<URI> repositoryUrl()
Repository URL.- Specified by:
repositoryUrl
in interfaceIssue
-
labelsUrl
@Nullable public String labelsUrl()
Labels URL template.
-
commentsUrl
@Nullable public URI commentsUrl()
Comments URL.- Specified by:
commentsUrl
in interfaceIssue
-
state
@Nullable public String state()
Indicates the state of the issues to return. Can be either open, closed, or all.
-
title
@Nullable public String title()
The title of the issue.
-
labels
@Nullable public List<Label> labels()
A list of comma separated label names. Example: bug,ui,@highl.
-
comments
@Nullable public Integer comments()
Number of comments.
-
pullRequest
public Optional<PullRequest> pullRequest()
Pull request.- Specified by:
pullRequest
in interfaceIssue
-
withCreatedAt
public final ImmutableIssue 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
-
withUpdatedAt
public final ImmutableIssue withUpdatedAt(@Nullable GitHubInstant value)
Copy the current immutable object by setting a value for theupdatedAt
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for updatedAt (can benull
)- Returns:
- A modified copy of the
this
object
-
withClosedAt
public final ImmutableIssue withClosedAt(GitHubInstant value)
Copy the current immutable object by setting a present value for the optionalclosedAt
attribute.- Parameters:
value
- The value for closedAt- Returns:
- A modified copy of
this
object
-
withClosedAt
public final ImmutableIssue withClosedAt(Optional<? extends GitHubInstant> optional)
Copy the current immutable object by setting an optional value for theclosedAt
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 closedAt- Returns:
- A modified copy of
this
object
-
withId
public final ImmutableIssue 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 ImmutableIssue 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
-
withEventsUrl
public final ImmutableIssue withEventsUrl(@Nullable Optional<URI> value)
Copy the current immutable object by setting a value for theeventsUrl
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for eventsUrl (can benull
)- Returns:
- A modified copy of the
this
object
-
withRepositoryUrl
public final ImmutableIssue withRepositoryUrl(@Nullable Optional<URI> value)
Copy the current immutable object by setting a value for therepositoryUrl
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for repositoryUrl (can benull
)- Returns:
- A modified copy of the
this
object
-
withLabelsUrl
public final ImmutableIssue withLabelsUrl(@Nullable String value)
Copy the current immutable object by setting a value for thelabelsUrl
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for labelsUrl (can benull
)- Returns:
- A modified copy of the
this
object
-
withCommentsUrl
public final ImmutableIssue withCommentsUrl(@Nullable URI value)
Copy the current immutable object by setting a value for thecommentsUrl
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for commentsUrl (can benull
)- Returns:
- A modified copy of the
this
object
-
withHtmlUrl
public final ImmutableIssue withHtmlUrl(@Nullable URI value)
Copy the current immutable object by setting a value for thehtmlUrl
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for htmlUrl (can benull
)- Returns:
- A modified copy of the
this
object
-
withNumber
public final ImmutableIssue withNumber(@Nullable Integer value)
Copy the current immutable object by setting a value for thenumber
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for number (can benull
)- Returns:
- A modified copy of the
this
object
-
withState
public final ImmutableIssue withState(@Nullable String value)
Copy the current immutable object by setting a value for thestate
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for state (can benull
)- Returns:
- A modified copy of the
this
object
-
withTitle
public final ImmutableIssue withTitle(@Nullable String value)
Copy the current immutable object by setting a value for thetitle
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for title (can benull
)- Returns:
- A modified copy of the
this
object
-
withBody
public final ImmutableIssue withBody(@Nullable Optional<String> value)
Copy the current immutable object by setting a value for thebody
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for body (can benull
)- Returns:
- A modified copy of the
this
object
-
withUser
public final ImmutableIssue withUser(@Nullable User value)
Copy the current immutable object by setting a value for theuser
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for user (can benull
)- Returns:
- A modified copy of the
this
object
-
withLabels
public final ImmutableIssue withLabels(@Nullable Label... elements)
Copy the current immutable object with elements that replace the content oflabels
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withLabels
public final ImmutableIssue withLabels(@Nullable Iterable<? extends Label> elements)
Copy the current immutable object with elements that replace the content oflabels
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
elements
- An iterable of labels elements to set- Returns:
- A modified copy of
this
object
-
withAssignee
public final ImmutableIssue withAssignee(User value)
Copy the current immutable object by setting a present value for the optionalassignee
attribute.- Parameters:
value
- The value for assignee- Returns:
- A modified copy of
this
object
-
withAssignee
public final ImmutableIssue withAssignee(Optional<? extends User> optional)
Copy the current immutable object by setting an optional value for theassignee
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 assignee- Returns:
- A modified copy of
this
object
-
withMilestone
public final ImmutableIssue withMilestone(Milestone value)
Copy the current immutable object by setting a present value for the optionalmilestone
attribute.- Parameters:
value
- The value for milestone- Returns:
- A modified copy of
this
object
-
withMilestone
public final ImmutableIssue withMilestone(Optional<? extends Milestone> optional)
Copy the current immutable object by setting an optional value for themilestone
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 milestone- Returns:
- A modified copy of
this
object
-
withLocked
public final ImmutableIssue withLocked(@Nullable Boolean value)
Copy the current immutable object by setting a value for thelocked
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for locked (can benull
)- Returns:
- A modified copy of the
this
object
-
withComments
public final ImmutableIssue withComments(@Nullable Integer value)
Copy the current immutable object by setting a value for thecomments
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for comments (can benull
)- Returns:
- A modified copy of the
this
object
-
withPullRequest
public final ImmutableIssue withPullRequest(PullRequest value)
Copy the current immutable object by setting a present value for the optionalpullRequest
attribute.- Parameters:
value
- The value for pullRequest- Returns:
- A modified copy of
this
object
-
withPullRequest
public final ImmutableIssue withPullRequest(Optional<? extends PullRequest> optional)
Copy the current immutable object by setting an optional value for thepullRequest
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 pullRequest- Returns:
- A modified copy of
this
object
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableIssue
that have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:createdAt
,updatedAt
,closedAt
,id
,url
,eventsUrl
,repositoryUrl
,labelsUrl
,commentsUrl
,htmlUrl
,number
,state
,title
,body
,user
,labels
,assignee
,milestone
,locked
,comments
,pullRequest
.
-
toString
public String toString()
Prints the immutable valueIssue
with attribute values.
-
copyOf
public static ImmutableIssue copyOf(Issue instance)
Creates an immutable copy of aIssue
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 Issue instance
-
builder
public static ImmutableIssue.Builder builder()
Creates a builder forImmutableIssue
.ImmutableIssue.builder() .createdAt(com.spotify.github.GitHubInstant | null) // nullable
createdAt
.updatedAt(com.spotify.github.GitHubInstant | null) // nullableupdatedAt
.closedAt(com.spotify.github.GitHubInstant) // optionalclosedAt
.id(Integer | null) // nullableid
.url(java.net.URI | null) // nullableurl
.eventsUrl(Optional<java.net.URI> | null) // nullableeventsUrl
.repositoryUrl(Optional<java.net.URI> | null) // nullablerepositoryUrl
.labelsUrl(String | null) // nullablelabelsUrl
.commentsUrl(java.net.URI | null) // nullablecommentsUrl
.htmlUrl(java.net.URI | null) // nullablehtmlUrl
.number(Integer | null) // nullablenumber
.state(String | null) // nullablestate
.title(String | null) // nullabletitle
.body(Optional<String> | null) // nullablebody
.user(com.spotify.github.v3.User | null) // nullableuser
.labels(List<com.spotify.github.v3.issues.Label> | null) // nullablelabels
.assignee(com.spotify.github.v3.User) // optionalassignee
.milestone(com.spotify.github.v3.Milestone) // optionalmilestone
.locked(Boolean | null) // nullablelocked
.comments(Integer | null) // nullablecomments
.pullRequest(com.spotify.github.v3.issues.PullRequest) // optionalpullRequest
.build();- Returns:
- A new ImmutableIssue builder
-
-