Package de.coho04.githubapi.builders
Klasse GHFileBuilder
java.lang.Object
de.coho04.githubapi.bases.GHBase
de.coho04.githubapi.builders.GHFileBuilder
- Alle implementierten Schnittstellen:
HttpRequestInterface,JSONHelper
GHFileBuilder is a class that extends GHBase. It represents a builder for creating and committing files to a GitHub repository.
It contains several properties such as branch, path, content, message, and repository.
These properties are initialized through the constructor and can be set using the provided setter methods.
- Seit:
- 2024-1.2
- Version:
- 1.0
- Autor:
- Coho04
-
Verschachtelte Klassen - Übersicht
Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen de.coho04.githubapi.interfaces.JSONHelper
JSONHelper.JSONToObject<T> -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungGHFileBuilder(GHRepository repository, GHBranch branch, Github github) Constructs a new GHFileBuilder object for a given repository and branch.GHFileBuilder(GHRepository repository, GHBranch branch, String path, String content, String message, Github github) Constructs a new GHFileBuilder object with all properties set.GHFileBuilder(GHRepository repository, Github github) Constructs a new GHFileBuilder object for a given repository. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidcommit()Commits the file to the repository using the authenticated user's email and login as the committer's details.voidCommits the file to the repository.Returns the branch where this file will be committed.Returns the content of the file to be committed.Returns the GitHub instance associated with this file builder.Returns the commit message for the file commit.getPath()Returns the path where the file will be committed.Returns the repository where this file will be committed.Sets the branch to which the file will be committed.Sets the branch to which the file will be committed.setContent(String content) Sets the content of the file.setMessage(String message) Sets the commit message.Sets the path of the file.Von Klasse geerbte Methoden de.coho04.githubapi.bases.GHBase
fetchArrayData, fetchArrayData, fetchPaginatedData, fetchPaginatedData, fetchPaginatedData, getBaseUrl, toJSONObjectVon Klasse geerbte Methoden java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitVon Schnittstelle geerbte Methoden de.coho04.githubapi.interfaces.HttpRequestInterface
extractNextPageUrl, sendDeleteRequest, sendDeleteRequestWithResponseCode, sendGetRequest, sendGetRequestWithLinkHeader, sendGetRequestWithResponseCode, sendPatchRequest, sendPostRequest, sendPutRequestVon Schnittstelle geerbte Methoden de.coho04.githubapi.interfaces.JSONHelper
getArrayOrNull, getBooleanOrNull, getIntOrNull, getJSONArrayToStringList, getJSONObjectOrNull, getLocalDateOrNull, getLongOrNull, getStringOrNull
-
Konstruktordetails
-
GHFileBuilder
Constructs a new GHFileBuilder object for a given repository.- Parameter:
repository- a GHRepository object representing the repository to which the file will be committed.
-
GHFileBuilder
Constructs a new GHFileBuilder object for a given repository and branch.- Parameter:
repository- a GHRepository object representing the repository to which the file will be committed.branch- a GHBranch object representing the branch to which the file will be committed.
-
GHFileBuilder
public GHFileBuilder(GHRepository repository, GHBranch branch, String path, String content, String message, Github github) Constructs a new GHFileBuilder object with all properties set.- Parameter:
repository- a GHRepository object representing the repository to which the file will be committed.branch- a GHBranch object representing the branch to which the file will be committed.path- a String representing the path of the file.content- a String representing the content of the file.message- a String representing the commit message.
-
-
Methodendetails
-
setBranch
Sets the branch to which the file will be committed.- Parameter:
branch- a GHBranch object representing the branch to which the file will be committed.- Gibt zurück:
- the current GHFileBuilder object.
-
setBranch
Sets the branch to which the file will be committed.- Parameter:
branch- a String representing the name of the branch to which the file will be committed.- Gibt zurück:
- the current GHFileBuilder object.
-
setContent
Sets the content of the file.- Parameter:
content- a String representing the content of the file.- Gibt zurück:
- the current GHFileBuilder object.
-
setMessage
Sets the commit message.- Parameter:
message- a String representing the commit message.- Gibt zurück:
- the current GHFileBuilder object.
-
setPath
Sets the path of the file.- Parameter:
path- a String representing the path of the file.- Gibt zurück:
- the current GHFileBuilder object.
-
getGithub
Returns the GitHub instance associated with this file builder.- Gibt zurück:
- the GitHub instance
-
getRepository
Returns the repository where this file will be committed.- Gibt zurück:
- the GHRepository instance
-
getBranch
Returns the branch where this file will be committed.- Gibt zurück:
- the GHBranch instance
-
getContent
Returns the content of the file to be committed.- Gibt zurück:
- the content of the file
-
getMessage
Returns the commit message for the file commit.- Gibt zurück:
- the commit message
-
getPath
Returns the path where the file will be committed.- Gibt zurück:
- the path of the file
-
commit
Commits the file to the repository. This method is not yet implemented. -
commit
public void commit()Commits the file to the repository using the authenticated user's email and login as the committer's details. This method first sends a GET request to retrieve the authenticated user's email. Then, it calls the overloaded commit method with the retrieved email and the authenticated user's login.
-