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 User
author()
Get its author.PullRef
base()
Get its base ref.String
body()
Get its body.void
body(String text)
Change its body.Date
closedAt()
When this pull request was closed.PullComments
comments()
Get Pull Comments.int
commentsCount()
Get comments count.Iterable<Commit>
commits()
Get all commits of the pull request.int
compareTo(Pull obj)
Date
createdAt()
When this pull request was created.Iterable<javax.json.JsonObject>
files()
List all files of the pull request.PullRef
head()
Get its head ref.URL
htmlUrl()
Get its HTML URL.boolean
isOpen()
Is it open?Issue
issue()
Get an issue where the pull request is submitted.javax.json.JsonObject
json()
Describe it in a JSON object.void
merge(String msg)
Merge it.MergeState
merge(String msg, String sha)
Merge it.Date
mergedAt()
When this pull request was merged.int
number()
Get its number.void
patch(javax.json.JsonObject json)
Patch using this JSON object.Repo
repo()
Repo we're in.String
state()
Get its state.void
state(String state)
Change its state.String
title()
Get its title.void
title(String text)
Change its title.Date
updatedAt()
When this pull request was updated.URL
url()
Get its URL.
-
-
-
Constructor Detail
-
Smart
public Smart(Pull pll)
Public ctor.- Parameters:
pll
- Pull request
-
-
Method Detail
-
isOpen
public boolean isOpen() throws IOException
Is 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 IOException
Get 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:Pull
Get its number.
-
commits
public Iterable<Commit> commits() throws IOException
Description copied from interface:Pull
Get all commits of the pull request.- Specified by:
commits
in 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:Pull
List all files of the pull request.- Specified by:
files
in 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:Pull
Merge it.- Specified by:
merge
in 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:Pull
Merge it.- Specified by:
merge
in 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:Pull
Get Pull Comments.- Specified by:
comments
in 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 IOException
Description copied from interface:JsonReadable
Describe it in a JSON object.- Specified by:
json
in interfaceJsonReadable
- Returns:
- JSON object
- Throws:
IOException
- If there is any I/O problem
-
patch
public void patch(javax.json.JsonObject json) throws IOException
Description copied from interface:JsonPatchable
Patch using this JSON object.- Specified by:
patch
in interfaceJsonPatchable
- Parameters:
json
- JSON object- Throws:
IOException
- If there is any I/O problem
-
compareTo
public int compareTo(Pull obj)
- Specified by:
compareTo
in interfaceComparable<Pull>
-
base
public PullRef base() throws IOException
Description copied from interface:Pull
Get its base ref.- Specified by:
base
in interfacePull
- Returns:
- Base ref
- Throws:
IOException
- If there is any I/O problem
-
head
public PullRef head() throws IOException
Description copied from interface:Pull
Get its head ref.- Specified by:
head
in interfacePull
- Returns:
- Head ref
- Throws:
IOException
- If there is any I/O problem
-
-