org.rhq.core.domain.content
Class RepoRelationship

java.lang.Object
  extended by org.rhq.core.domain.content.RepoRelationship
All Implemented Interfaces:
Serializable

public class RepoRelationship
extends Object
implements Serializable

A RepoRelationship represents relationship with a Repo having a (@link RepoRelationshipType) which can represent parent/child, clone relationship etc.

See Also:
Serialized Form

Field Summary
static String DELETE_BY_RELATED_REPO_ID
           
 
Constructor Summary
RepoRelationship()
           
 
Method Summary
 RepoRepoRelationship addRepo(Repo repo)
          Directly assign a repo to this repo relationship.
 boolean equals(Object obj)
           
 int getId()
           
 Repo getRelatedRepo()
           
 Set<Repo> getRelatedRepos()
          The repos that this repo relationship is associated with.
 RepoRelationshipType getRepoRelationshipType()
          Describes the type of this repoRelationship.
 Set<RepoRepoRelationship> getRepoRepoRelationships()
          Returns the explicit mapping entities.
 int hashCode()
           
 RepoRepoRelationship removeRepo(Repo repo)
          Removes the repo from this repo relationship, if it exists.
 void setId(int id)
           
 void setRelatedRepo(Repo relatedRepo)
           
 void setRepoRelationshipType(RepoRelationshipType repoRelationshipType)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DELETE_BY_RELATED_REPO_ID

public static final String DELETE_BY_RELATED_REPO_ID
See Also:
Constant Field Values
Constructor Detail

RepoRelationship

public RepoRelationship()
Method Detail

getId

public int getId()

setId

public void setId(int id)

getRelatedRepo

public Repo getRelatedRepo()

setRelatedRepo

public void setRelatedRepo(Repo relatedRepo)

getRepoRelationshipType

public RepoRelationshipType getRepoRelationshipType()
Describes the type of this repoRelationship.


setRepoRelationshipType

public void setRepoRelationshipType(RepoRelationshipType repoRelationshipType)

getRepoRepoRelationships

public Set<RepoRepoRelationship> getRepoRepoRelationships()
Returns the explicit mapping entities.

Returns:
the mapping entities
See Also:
#getRepoRelationship()

getRelatedRepos

public Set<Repo> getRelatedRepos()
The repos that this repo relationship is associated with.

The returned set is not backed by this entity - if you want to alter the set of associated repos, use getRepoRepoRelationships() or addRepo(Repo), removeRepo(Repo).


addRepo

public RepoRepoRelationship addRepo(Repo repo)
Directly assign a repo to this repo relationship.

Parameters:
repo -
Returns:
the mapping that was added

removeRepo

public RepoRepoRelationship removeRepo(Repo repo)
Removes the repo from this repo relationship, if it exists. If it does exist, the mapping that was removed is returned; if the given repo did not did not belong to this repo relationship, null is returned.

Parameters:
repo - the repo to remove from this repo relationship
Returns:
the mapping that was removed or null if the repo did not belong to this repo relationship

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

equals

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


Copyright © 2008-2011 Red Hat, Inc.. All Rights Reserved.