org.eclipse.egit.github.core
Class RepositoryId

java.lang.Object
  extended by org.eclipse.egit.github.core.RepositoryId
All Implemented Interfaces:
Serializable, IRepositoryIdProvider

public class RepositoryId
extends Object
implements IRepositoryIdProvider, Serializable

Repository id

See Also:
Serialized Form

Constructor Summary
RepositoryId(String owner, String name)
          Create repository id with given owner and name.
 
Method Summary
static RepositoryId create(String owner, String name)
          Create repository id from given owner and name.
static RepositoryId createFromId(String id)
          Create repository from id.
static RepositoryId createFromUrl(String url)
          Create from string URL
static RepositoryId createFromUrl(URL url)
          Create repository from url.
 boolean equals(Object obj)
           
 String generateId()
          Generate a repository id
 String getName()
           
 String getOwner()
           
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RepositoryId

public RepositoryId(String owner,
                    String name)
Create repository id with given owner and name. This constructor validates the parameters and throws an IllegalArgumentException if either is null or empty.

Parameters:
owner - must be non-null and non-empty
name - must be non-null and non-empty
Method Detail

createFromUrl

public static RepositoryId createFromUrl(URL url)
Create repository from url.

Parameters:
url -
Returns:
repository or null if parsing fails
See Also:
createFromId(String)

createFromId

public static RepositoryId createFromId(String id)
Create repository from id. The id is split on the '/' character and the first two non-empty segments are interpreted to be the repository owner and name.

Parameters:
id -
Returns:
repository

createFromUrl

public static RepositoryId createFromUrl(String url)
Create from string URL

Parameters:
url -
Returns:
repository or null if it could not be parsed from URL path
See Also:
createFromUrl(URL)

create

public static RepositoryId create(String owner,
                                  String name)
Create repository id from given owner and name.

Parameters:
owner -
name -
Returns:
repository id

getOwner

public String getOwner()
Returns:
owner

getName

public String getName()
Returns:
name

generateId

public String generateId()
Description copied from interface: IRepositoryIdProvider
Generate a repository id

Specified by:
generateId in interface IRepositoryIdProvider
Returns:
repository id

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012. All Rights Reserved.