Package org.vx68k.bitbucket.api.client
Class BitbucketClientRepository
- java.lang.Object
 - 
- org.vx68k.bitbucket.api.client.BitbucketClientObject
 - 
- org.vx68k.bitbucket.api.client.BitbucketClientRepository
 
 
 
- 
- All Implemented Interfaces:
 BitbucketIssueTracker,BitbucketRepository
public class BitbucketClientRepository extends BitbucketClientObject implements BitbucketRepository, BitbucketIssueTracker
Client implementation ofBitbucketRepository. This class represents a repository by a JSON object.- Since:
 - 5.0
 - Author:
 - Kaz Nishimura
 
 
- 
- 
Field Summary
- 
Fields inherited from interface org.vx68k.bitbucket.api.BitbucketRepository
GIT, HG 
 - 
 
- 
Constructor Summary
Constructors Constructor Description BitbucketClientRepository(JsonObject object)Constructs this object.BitbucketClientRepository(JsonObject object, BitbucketClient client)Constructs this object with a Bitbucket client. 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Function<JsonObject,BitbucketClientRepository>creator()Returns a function to create a repository from a JSON object.static Function<JsonObject,BitbucketClientRepository>creator(BitbucketClient bitbucketClient)Returns a function to create a repository from a JSON object.InstantgetCreated()Returns the time when the repository was created.StringgetDescription()Returns the description of the repository.StringgetFullName()Returns the full name of the repository.BitbucketIssuegetIssue(int id)Returns the issue specified by an identifier.BitbucketIssueTrackergetIssueTracker()Returns the issue tracker of the repository.BitbucketBranchgetMainBranch()Returns the main branch of the repository.StringgetName()Returns the name of the repository.BitbucketAccountgetOwner()Returns the owner of the repository.BitbucketRepositorygetRepository()Returns the repository of the issue tracker.StringgetSCM()Returns the SCM type of the repository.longgetSize()Returns the size of the repository.InstantgetUpdated()Returns the time when the repository was last updated.UUIDgetUUID()Returns the UUID of the repository.booleanhasIssueTracker()Returnstrueif and only if the repository has a issue tracker.booleanhasWiki()Returnstrueif and only if the repository has a wiki.booleanisPrivate()Returnstrueif and only if the repository is private.Collection<BitbucketIssue>issues()Returns a collection view of the issues.Collection<BitbucketIssue>issues(String filter)Returns a collection view of the issues that match a filter expression.- 
Methods inherited from class org.vx68k.bitbucket.api.client.BitbucketClientObject
equals, getBitbucketClient, getJsonObject, getLink, getType, hashCode, setBitbucketClient, toString 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
BitbucketClientRepository
public BitbucketClientRepository(JsonObject object)
Constructs this object.- Parameters:
 object- JSON object for a repository- Throws:
 IllegalArgumentException- ifobjectisnullor is not for a repository
 
- 
BitbucketClientRepository
public BitbucketClientRepository(JsonObject object, BitbucketClient client)
Constructs this object with a Bitbucket client.- Parameters:
 object- JSON object for a repositoryclient- Bitbucket client- Throws:
 IllegalArgumentException- ifobjectisnullor is not for a repository
 
 - 
 
- 
Method Detail
- 
creator
public static Function<JsonObject,BitbucketClientRepository> creator()
Returns a function to create a repository from a JSON object. The returned function initializes the Bitbucket API client of the created repository tonull.This method can be used to create a
PaginatedListobject.- Returns:
 - a function to create a repository from a JSON object
 - See Also:
 creator(BitbucketClient),PaginatedList
 
- 
creator
public static Function<JsonObject,BitbucketClientRepository> creator(BitbucketClient bitbucketClient)
Returns a function to create a repository from a JSON object.This method can be used to create a
PaginatedListobject.- Parameters:
 bitbucketClient- a Bitbucket API client- Returns:
 - a function to create a repository from a JSON object
 - See Also:
 PaginatedList
 
- 
getSCM
public final String getSCM()
Returns the SCM type of the repository. The return value shall be either#GITor#HG.- Specified by:
 getSCMin interfaceBitbucketRepository- Returns:
 - the SCM type of the repository
 
 
- 
getOwner
public final BitbucketAccount getOwner()
Returns the owner of the repository.- Specified by:
 getOwnerin interfaceBitbucketRepository- Returns:
 - the owner of the repository
 
 
- 
getName
public final String getName()
Returns the name of the repository.- Specified by:
 getNamein interfaceBitbucketRepository- Returns:
 - the name of the repository
 
 
- 
getUUID
public final UUID getUUID()
Returns the UUID of the repository.- Specified by:
 getUUIDin interfaceBitbucketRepository- Returns:
 - the UUID of the repository
 
 
- 
getFullName
public final String getFullName()
Returns the full name of the repository.- Specified by:
 getFullNamein interfaceBitbucketRepository- Returns:
 - the full name of the repository
 
 
- 
getDescription
public final String getDescription()
Returns the description of the repository.This implementation takes the string of
"description"in the underlying JSON object.- Specified by:
 getDescriptionin interfaceBitbucketRepository- Returns:
 - the description of the repository
 
 
- 
isPrivate
public final boolean isPrivate()
Returnstrueif and only if the repository is private.- Specified by:
 isPrivatein interfaceBitbucketRepository- Returns:
 trueif and only if the repository is private
 
- 
getMainBranch
public final BitbucketBranch getMainBranch()
Returns the main branch of the repository.This implementation takes the object of
"mainbranch"in the underlying JSON object.- Specified by:
 getMainBranchin interfaceBitbucketRepository- Returns:
 - the main branch of the repository
 
 
- 
hasIssueTracker
public final boolean hasIssueTracker()
Description copied from interface:BitbucketRepositoryReturnstrueif and only if the repository has a issue tracker.- Specified by:
 hasIssueTrackerin interfaceBitbucketRepository- Returns:
 trueif and only if the repository has a issue tracker
 
- 
hasWiki
public final boolean hasWiki()
Description copied from interface:BitbucketRepositoryReturnstrueif and only if the repository has a wiki.- Specified by:
 hasWikiin interfaceBitbucketRepository- Returns:
 trueif and only if the repository has a wiki
 
- 
getSize
public final long getSize()
Description copied from interface:BitbucketRepositoryReturns the size of the repository.- Specified by:
 getSizein interfaceBitbucketRepository- Returns:
 - the size of the repository
 
 
- 
getCreated
public final Instant getCreated()
Returns the time when the repository was created.This implementation takes the date-time value of
"created_on"in the underlying JSON object.- Specified by:
 getCreatedin interfaceBitbucketRepository- Returns:
 - the time when the repository was created
 
 
- 
getUpdated
public final Instant getUpdated()
Returns the time when the repository was last updated.This implementation takes the date-time value of
"updated_on"in the underlying JSON object.- Specified by:
 getUpdatedin interfaceBitbucketRepository- Returns:
 - the time when the repository was last updated
 
 
- 
getIssueTracker
public final BitbucketIssueTracker getIssueTracker()
Description copied from interface:BitbucketRepositoryReturns the issue tracker of the repository.- Specified by:
 getIssueTrackerin interfaceBitbucketRepository- Returns:
 - the issue tracker of the repository
 
 
- 
getRepository
public final BitbucketRepository getRepository()
Description copied from interface:BitbucketIssueTrackerReturns the repository of the issue tracker.- Specified by:
 getRepositoryin interfaceBitbucketIssueTracker- Returns:
 - the repository of the issue tracker
 
 
- 
getIssue
public final BitbucketIssue getIssue(int id)
Returns the issue specified by an identifier.- Specified by:
 getIssuein interfaceBitbucketIssueTracker- Parameters:
 id- identifier of the issue- Returns:
 - issue if found, 
nullotherwise 
 
- 
issues
public final Collection<BitbucketIssue> issues()
Returns a collection view of the issues. The order of the returned issues are unspecified.- Specified by:
 issuesin interfaceBitbucketIssueTracker- Returns:
 - a 
Collectionview of the issues 
 
- 
issues
public final Collection<BitbucketIssue> issues(String filter)
Description copied from interface:BitbucketIssueTrackerReturns a collection view of the issues that match a filter expression. The order of the returned issues are unspecified.- Specified by:
 issuesin interfaceBitbucketIssueTracker- Parameters:
 filter- a filter expression- Returns:
 - a 
Collectionview of the issues 
 
 - 
 
 -