Package com.jcabi.github
Class Repos.RepoCreate
- java.lang.Object
-
- com.jcabi.github.Repos.RepoCreate
-
- All Implemented Interfaces:
JsonReadable
- Enclosing interface:
- Repos
@Loggable(1) public static final class Repos.RepoCreate extends Object implements JsonReadable
Settings to use when creating a new GitHub repository.- Since:
- 0.24
- Version:
- $Id: 7a994514f14522a5c35ba73a5614b31cc3312895 $
- Author:
- Chris Rebert (github@rebertia.com)
- See Also:
- Create Repo API
- To do:
- #1095:30m Add the ability to set the other parameters of the repo creation API (has_issues, has_wiki, has_downloads, team_id, gitignore_template, license_template).
-
-
Constructor Summary
Constructors Constructor Description RepoCreate(String nme, boolean prvt)Public ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.common.base.Optional<Boolean>autoInit()Auto-init the new repo? If absent, the GitHub default will be used.Stringdescription()Description of the new repo.Stringhomepage()Homepage of the new repo.booleanisPrivate()Will the new repo be private? If not, then it will be public.javax.json.JsonObjectjson()Describe it in a JSON object.Stringname()Name of the new repo.Stringorganization()Name of the organization to which this repo belongs.Repos.RepoCreatewithAutoInit(boolean auto)Returns a RepoCreate with the given auto-init enabledness.Repos.RepoCreatewithAutoInit(com.google.common.base.Optional<Boolean> auto)Returns a RepoCreate with the given auto-init enabledness.Repos.RepoCreatewithDescription(String desc)Returns a RepoCreate with the given description.Repos.RepoCreatewithHomepage(String page)Returns a RepoCreate with the given homepage.Repos.RepoCreatewithName(String nme)Returns a RepoCreate with the given name.Repos.RepoCreatewithOrganization(String org)Returns a RepoCreate with the given organization.Repos.RepoCreatewithPrivacy(boolean privacy)Returns a RepoCreate with the given privacy.
-
-
-
Constructor Detail
-
RepoCreate
public RepoCreate(String nme, boolean prvt)
Public ctor.- Parameters:
nme- Name of the new repository. Cannot be empty.prvt- Will the new repo be private? If not, then it will be public.
-
-
Method Detail
-
name
public String name()
Name of the new repo.- Returns:
- Name
-
isPrivate
public boolean isPrivate()
Will the new repo be private? If not, then it will be public.- Returns:
- Is this repo private?
-
description
public String description()
Description of the new repo. If it has no description, this is an empty string.- Returns:
- Description
-
homepage
public String homepage()
Homepage of the new repo. If it has no homepage, this is an empty string.- Returns:
- Homepage
-
autoInit
public com.google.common.base.Optional<Boolean> autoInit()
Auto-init the new repo? If absent, the GitHub default will be used.- Returns:
- Optional boolean
-
organization
public String organization()
Name of the organization to which this repo belongs.- Returns:
- String org name
-
withName
public Repos.RepoCreate withName(String nme)
Returns a RepoCreate with the given name. The name cannot be empty.- Parameters:
nme- Name of the new repo- Returns:
- RepoCreate
-
withPrivacy
public Repos.RepoCreate withPrivacy(boolean privacy)
Returns a RepoCreate with the given privacy.- Parameters:
privacy- Privateness of the new repo- Returns:
- RepoCreate
-
withDescription
public Repos.RepoCreate withDescription(String desc)
Returns a RepoCreate with the given description.- Parameters:
desc- Description- Returns:
- RepoCreate
-
withHomepage
public Repos.RepoCreate withHomepage(String page)
Returns a RepoCreate with the given homepage.- Parameters:
page- Homepage URL- Returns:
- RepoCreate
-
withAutoInit
public Repos.RepoCreate withAutoInit(com.google.common.base.Optional<Boolean> auto)
Returns a RepoCreate with the given auto-init enabledness.- Parameters:
auto- Auto-init the new repo?- Returns:
- RepoCreate
-
withAutoInit
public Repos.RepoCreate withAutoInit(boolean auto)
Returns a RepoCreate with the given auto-init enabledness.- Parameters:
auto- Auto-init the new repo?- Returns:
- RepoCreate
-
withOrganization
public Repos.RepoCreate withOrganization(String org)
Returns a RepoCreate with the given organization.- Parameters:
org- Organization to which this repo belongs.- Returns:
- RepoCreate
-
json
public javax.json.JsonObject json()
Description copied from interface:JsonReadableDescribe it in a JSON object.- Specified by:
jsonin interfaceJsonReadable- Returns:
- JSON object
-
-