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.
Since:
0.3
  • Constructor Details

    • Smart

      public Smart(Pull pll)
      Public ctor.
      Parameters:
      pll - Pull request
  • Method Details

    • 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
    • repo

      public Repo repo()
      Description copied from interface: Pull
      Repo we're in.
      Specified by:
      repo in interface Pull
      Returns:
      Repo
    • number

      public int number()
      Description copied from interface: Pull
      Get its number.
      Specified by:
      number in interface Pull
      Returns:
      Pull request number
    • commits

      public Iterable<Commit> commits() throws IOException
      Description copied from interface: Pull
      Get all commits of the pull request.
      Specified by:
      commits in interface Pull
      Returns:
      Commits
      Throws:
      IOException - If there is any I/O problem
      See Also:
    • files

      public Iterable<jakarta.json.JsonObject> files() throws IOException
      Description copied from interface: Pull
      List all files of the pull request.
      Specified by:
      files in interface Pull
      Returns:
      Files
      Throws:
      IOException - If there is any I/O problem
      See Also:
    • merge

      public void merge(String msg) throws IOException
      Description copied from interface: Pull
      Merge it.
      Specified by:
      merge in interface Pull
      Parameters:
      msg - Commit message
      Throws:
      IOException - If there is any I/O problem
      See Also:
    • merge

      public MergeState merge(String msg, String sha) throws IOException
      Description copied from interface: Pull
      Merge it.
      Specified by:
      merge in interface Pull
      Parameters:
      msg - Commit message
      sha - 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 interface Pull
      Returns:
      Comments.
      Throws:
      IOException - If there is any I/O problem
      See Also:
    • checks

      public Checks checks() throws IOException
      Description copied from interface: Pull
      Get Pull Checks.
      Specified by:
      checks in interface Pull
      Returns:
      Checks.
      Throws:
      IOException - If there is any I/O problem.
      See Also:
    • json

      public jakarta.json.JsonObject json() throws IOException
      Description copied from interface: JsonReadable
      Describe it in a JSON object.
      Specified by:
      json in interface JsonReadable
      Returns:
      JSON object
      Throws:
      IOException - If there is any I/O problem
    • patch

      public void patch(jakarta.json.JsonObject json) throws IOException
      Description copied from interface: JsonPatchable
      Patch using this JSON object.
      Specified by:
      patch in interface JsonPatchable
      Parameters:
      json - JSON object
      Throws:
      IOException - If there is any I/O problem
    • compareTo

      public int compareTo(Pull obj)
      Specified by:
      compareTo in interface Comparable<Pull>
    • base

      public PullRef base() throws IOException
      Description copied from interface: Pull
      Get its base ref.
      Specified by:
      base in interface Pull
      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 interface Pull
      Returns:
      Head ref
      Throws:
      IOException - If there is any I/O problem