Package com.jcabi.github
Class Pull.Smart
- java.lang.Object
-
- com.jcabi.github.Pull.Smart
-
- All Implemented Interfaces:
JsonPatchable,JsonReadable,Pull,Comparable<Pull>
- Enclosing interface:
- Pull
@Immutable @Loggable(1) public static final class Pull.Smart extends Object implements Pull
Smart pull request with extra features.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.jcabi.github.Pull
Pull.Smart
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Userauthor()Get its author.PullRefbase()Get its base ref.Stringbody()Get its body.voidbody(String text)Change its body.DateclosedAt()When this pull request was closed.PullCommentscomments()Get Pull Comments.intcommentsCount()Get comments count.Iterable<Commit>commits()Get all commits of the pull request.intcompareTo(Pull obj)DatecreatedAt()When this pull request was created.Iterable<javax.json.JsonObject>files()List all files of the pull request.PullRefhead()Get its head ref.URLhtmlUrl()Get its HTML URL.booleanisOpen()Is it open?Issueissue()Get an issue where the pull request is submitted.javax.json.JsonObjectjson()Describe it in a JSON object.voidmerge(String msg)Merge it.MergeStatemerge(String msg, String sha)Merge it.DatemergedAt()When this pull request was merged.intnumber()Get its number.voidpatch(javax.json.JsonObject json)Patch using this JSON object.Reporepo()Repo we're in.Stringstate()Get its state.voidstate(String state)Change its state.Stringtitle()Get its title.voidtitle(String text)Change its title.DateupdatedAt()When this pull request was updated.URLurl()Get its URL.
-
-
-
Constructor Detail
-
Smart
public Smart(Pull pll)
Public ctor.- Parameters:
pll- Pull request
-
-
Method Detail
-
isOpen
public boolean isOpen() throws IOExceptionIs it open?- Returns:
- TRUE if it's open
- Throws:
IOException- If there is any I/O problem
-
state
public String state() throws IOException
Get its state.- Returns:
- State of pull request
- Throws:
IOException- If there is any I/O problem
-
state
public void state(String state) throws IOException
Change its state.- Parameters:
state- State of pull request- Throws:
IOException- If there is any I/O problem
-
title
public String title() throws IOException
Get its title.- Returns:
- Title of pull request
- Throws:
IOException- If there is any I/O problem
-
title
public void title(String text) throws IOException
Change its title.- Parameters:
text- Title of pull request- Throws:
IOException- If there is any I/O problem
-
body
public String body() throws IOException
Get its body.- Returns:
- Body of pull request
- Throws:
IOException- If there is any I/O problem
-
body
public void body(String text) throws IOException
Change its body.- Parameters:
text- Body of pull request- Throws:
IOException- If there is any I/O problem
-
url
public URL url() throws IOException
Get its URL.- Returns:
- URL of pull request
- Throws:
IOException- If there is any I/O problem
-
htmlUrl
public URL htmlUrl() throws IOException
Get its HTML URL.- Returns:
- URL of pull request
- Throws:
IOException- If there is any I/O problem
-
createdAt
public Date createdAt() throws IOException
When this pull request was created.- Returns:
- Date of creation
- Throws:
IOException- If there is any I/O problem
-
updatedAt
public Date updatedAt() throws IOException
When this pull request was updated.- Returns:
- Date of update
- Throws:
IOException- If there is any I/O problem
-
closedAt
public Date closedAt() throws IOException
When this pull request was closed.- Returns:
- Date of closing
- Throws:
IOException- If there is any I/O problem
-
mergedAt
public Date mergedAt() throws IOException
When this pull request was merged.- Returns:
- Date of merging
- Throws:
IOException- If there is any I/O problem
-
author
public User author() throws IOException
Get its author.- Returns:
- Author of pull request (who submitted it)
- Throws:
IOException- If there is any I/O problem
-
issue
public Issue issue()
Get an issue where the pull request is submitted.- Returns:
- Issue
-
commentsCount
public int commentsCount() throws IOExceptionGet comments count.- Returns:
- Count of comments
- Throws:
IOException- If there is any I/O problem- Since:
- 0.8
-
number
public int number()
Description copied from interface:PullGet its number.
-
commits
public Iterable<Commit> commits() throws IOException
Description copied from interface:PullGet all commits of the pull request.- Specified by:
commitsin interfacePull- Returns:
- Commits
- Throws:
IOException- If there is any I/O problem- See Also:
- List Commits on a Pull Request
-
files
public Iterable<javax.json.JsonObject> files() throws IOException
Description copied from interface:PullList all files of the pull request.- Specified by:
filesin interfacePull- Returns:
- Files
- Throws:
IOException- If there is any I/O problem- See Also:
- List Pull Request Files
-
merge
public void merge(String msg) throws IOException
Description copied from interface:PullMerge it.- Specified by:
mergein interfacePull- Parameters:
msg- Commit message- Throws:
IOException- If there is any I/O problem- See Also:
- Merge a Pull Request
-
merge
public MergeState merge(String msg, String sha) throws IOException
Description copied from interface:PullMerge it.- Specified by:
mergein interfacePull- Parameters:
msg- Commit messagesha- Optional SHA hash for head comparison- Returns:
- State of the Merge
- Throws:
IOException- IOException If there is any I/O problem
-
comments
public PullComments comments() throws IOException
Description copied from interface:PullGet Pull Comments.- Specified by:
commentsin interfacePull- Returns:
- Comments.
- Throws:
IOException- If there is any I/O problem- See Also:
- Link Relations - Review Comments
-
json
public javax.json.JsonObject json() throws IOExceptionDescription copied from interface:JsonReadableDescribe it in a JSON object.- Specified by:
jsonin interfaceJsonReadable- Returns:
- JSON object
- Throws:
IOException- If there is any I/O problem
-
patch
public void patch(javax.json.JsonObject json) throws IOExceptionDescription copied from interface:JsonPatchablePatch using this JSON object.- Specified by:
patchin interfaceJsonPatchable- Parameters:
json- JSON object- Throws:
IOException- If there is any I/O problem
-
compareTo
public int compareTo(Pull obj)
- Specified by:
compareToin interfaceComparable<Pull>
-
base
public PullRef base() throws IOException
Description copied from interface:PullGet its base ref.- Specified by:
basein interfacePull- Returns:
- Base ref
- Throws:
IOException- If there is any I/O problem
-
head
public PullRef head() throws IOException
Description copied from interface:PullGet its head ref.- Specified by:
headin interfacePull- Returns:
- Head ref
- Throws:
IOException- If there is any I/O problem
-
-