Package com.jcabi.github.mock
Class MkOrganization
- java.lang.Object
-
- com.jcabi.github.mock.MkOrganization
-
- All Implemented Interfaces:
JsonPatchable,JsonReadable,Organization,Comparable<Organization>
@Immutable @Loggable(1) public final class MkOrganization extends Object implements Organization
Mock GitHub organization.- Since:
- 0.24
- Version:
- $Id: c04e47f965d345c60423d75f72ec54ac7b10609a $
- Author:
- Paul Polishchuk (ppol@ua.fm)
- See Also:
- Organizations API
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.jcabi.github.Organization
Organization.Smart
-
-
Constructor Summary
Constructors Constructor Description MkOrganization(MkStorage stg, String login)Public ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMember(User user)Add the given user to this organization.intcompareTo(Organization obj)Githubgithub()Github we're in.javax.json.JsonObjectjson()Describe it in a JSON object.Stringlogin()Get this organization's login.voidpatch(javax.json.JsonObject json)Patch using this JSON object.PublicMemberspublicMembers()Get this organization's public members.
-
-
-
Method Detail
-
github
public Github github()
Description copied from interface:OrganizationGithub we're in.- Specified by:
githubin interfaceOrganization- Returns:
- Github
-
login
public String login()
Description copied from interface:OrganizationGet this organization's login.- Specified by:
loginin interfaceOrganization- Returns:
- Login name
-
json
public javax.json.JsonObject json()
Description copied from interface:JsonReadableDescribe it in a JSON object.- Specified by:
jsonin interfaceJsonReadable- Returns:
- JSON object
-
compareTo
public int compareTo(Organization obj)
- Specified by:
compareToin interfaceComparable<Organization>
-
patch
public void patch(javax.json.JsonObject json) throws IOExceptionDescription copied from interface:JsonPatchablePatch using this JSON object.- Specified by:
patchin interfaceJsonPatchable- Parameters:
json- JSON object- Throws:
IOException- If there is any I/O problem
-
publicMembers
public PublicMembers publicMembers()
Description copied from interface:OrganizationGet this organization's public members.- Specified by:
publicMembersin interfaceOrganization- Returns:
- Public members
-
addMember
public void addMember(User user)
Add the given user to this organization.- Parameters:
user- User to add to the organization- To do:
- #1107:30min Implement the "Add team membership" API (see https://developer.github.com/v3/orgs/teams/#add-team-membership ) (per https://developer.github.com/v3/orgs/members/#add-a-member , you can't add a user directly to an org; you instead add them to one of that org's teams) and replace uses of this method with uses of that API (or downgrade this method to a convenience method for unit tests).
-
-