org.rhq.core.domain.resource
Class ProductVersion

java.lang.Object
  extended by org.rhq.core.domain.resource.ProductVersion
All Implemented Interfaces:
Serializable

public class ProductVersion
extends Object
implements Serializable

Used as a mapping between a resource and a package version. The resource will reference an instance of this entity to indicate the version of the resource. A package version can optionally reference an entity of this class to indicate it can only be installed on resources of a specific version.

See Also:
Serialized Form

Field Summary
static String QUERY_FIND_BY_RESOURCE_TYPE_AND_VERSION
           
 
Constructor Summary
ProductVersion()
           
 
Method Summary
 ProductVersionPackageVersion addPackageVersion(PackageVersion packageVersion)
          Directly assign a package version to this product version.
 boolean equals(Object o)
           
 int getId()
           
 Set<PackageVersion> getPackageVersions()
          The package versions that this product version is associated with.
 Set<ProductVersionPackageVersion> getProductVersionPackageVersions()
          Returns the explicit mapping entities.
 Set<Resource> getResources()
           
 ResourceType getResourceType()
           
 String getVersion()
           
 int hashCode()
           
 ProductVersionPackageVersion removePackageVersion(PackageVersion packageVersion)
          Removes the package version from this product version, if it exists.
 void setId(int id)
           
 void setResources(Set<Resource> resources)
           
 void setResourceType(ResourceType resourceType)
           
 void setVersion(String version)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

QUERY_FIND_BY_RESOURCE_TYPE_AND_VERSION

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

ProductVersion

public ProductVersion()
Method Detail

getId

public int getId()

setId

public void setId(int id)

getVersion

public String getVersion()

setVersion

public void setVersion(String version)

getResourceType

public ResourceType getResourceType()

setResourceType

public void setResourceType(ResourceType resourceType)

getResources

public Set<Resource> getResources()

setResources

public void setResources(Set<Resource> resources)

getProductVersionPackageVersions

public Set<ProductVersionPackageVersion> getProductVersionPackageVersions()
Returns the explicit mapping entities.

Returns:
the mapping entities
See Also:
getPackageVersions()

getPackageVersions

public Set<PackageVersion> getPackageVersions()
The package versions that this product version is associated with.

The returned set is not backed by this entity - if you want to alter the set of associated package versions, use getProductVersionPackageVersions() or addPackageVersion(PackageVersion), removePackageVersion(PackageVersion).


addPackageVersion

public ProductVersionPackageVersion addPackageVersion(PackageVersion packageVersion)
Directly assign a package version to this product version.

Parameters:
packageVersion -
Returns:
the mapping that was added

removePackageVersion

public ProductVersionPackageVersion removePackageVersion(PackageVersion packageVersion)
Removes the package version from this product version, if it exists. If it does exist, the mapping that was removed is returned; if the given package version did not exist as one that is a member of this product version, null is returned.

Parameters:
packageVersion - the package version to remove
Returns:
the mapping that was removed or null if the package version was not mapped to this product version

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


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