Class GHProjectBuilder

java.lang.Object
io.github.coho04.githubapi.bases.GHBase
io.github.coho04.githubapi.builders.GHProjectBuilder
All Implemented Interfaces:
HttpRequestInterface, JSONHelper

public class GHProjectBuilder extends GHBase
This class is used to build a new GitHub project. It extends GHBase and provides methods for setting the project's name and body, and for building the project.
  • Constructor Details

    • GHProjectBuilder

      public GHProjectBuilder(Github github, String url)
      Constructs a new GHProjectBuilder instance with the provided GitHub instance and URL.
      Parameters:
      github - the GitHub instance
      url - the URL
  • Method Details

    • setBody

      public GHProjectBuilder setBody(String body)
      Sets the body of the project.
      Parameters:
      body - the body of the project
      Returns:
      the GHProjectBuilder instance
    • setName

      public GHProjectBuilder setName(String name)
      Sets the name of the project.
      Parameters:
      name - the name of the project
      Returns:
      the GHProjectBuilder instance
    • toJSONObject

      public org.json.JSONObject toJSONObject()
      Converts the GHProjectBuilder instance to a JSONObject.
      Overrides:
      toJSONObject in class GHBase
      Returns:
      the JSONObject
    • build

      public GHProject build()
      Builds the project and returns a new GHProject instance.
      Returns:
      the GHProject instance
    • getName

      public String getName()
      Returns the name of the project.
      Returns:
      the name of the project
    • getGithub

      public Github getGithub()
      Returns the GitHub instance.
      Returns:
      the GitHub instance
    • getBody

      public String getBody()
      Returns the body of the project.
      Returns:
      the body of the project
    • getUrl

      public String getUrl()
      Returns the URL.
      Returns:
      the URL