org.rhq.core.domain.resource
Class ResourceSubCategory

java.lang.Object
  extended by org.rhq.core.domain.resource.ResourceSubCategory
All Implemented Interfaces:
Serializable, Comparable<ResourceSubCategory>

public class ResourceSubCategory
extends Object
implements Comparable<ResourceSubCategory>, Serializable

Class representing a sub category, where a sub category is meant to group similar resource types together.

See Also:
Serialized Form

Field Summary
static String QUERY_FIND_BY_NAME_AND_PLUGIN
           
 
Constructor Summary
ResourceSubCategory()
           
ResourceSubCategory(String name)
           
 
Method Summary
 void addChildSubCategory(ResourceSubCategory childSubCategory)
          add a child ResourceSubCategory to this instance
 int compareTo(ResourceSubCategory that)
           
 boolean equals(Object o)
           
 ResourceType findParentResourceType()
           
 Set<ResourceType> findTaggedResourceTypes()
          Returns the resource types that belong to this subcategory; the Set of types is sorted by name.
 List<ResourceSubCategory> getChildSubCategories()
           
 long getCtime()
           
 String getDescription()
           
 String getDisplayName()
           
 int getId()
           
 long getMtime()
           
 String getName()
           
 ResourceSubCategory getParentSubCategory()
          Returns this subcategory's parent subcategory, or null if this subcateogry has no parent.
 ResourceType getResourceType()
           
 int hashCode()
           
 boolean isCreatable()
           
 void removeChildSubCategory(ResourceSubCategory oldChildSubCategory)
          Removes the given ResourceSubCategory as a child of this ResourceSubCategory
 void setChildSubCategories(List<ResourceSubCategory> childSubCategories)
           
 void setDescription(String description)
           
 void setDisplayName(String displayName)
           
 void setId(int id)
           
 void setName(String name)
           
 void setParentSubCategory(ResourceSubCategory parentSubCategory)
           
 void setResourceType(ResourceType resourceType)
           
 String toString()
           
 void update(ResourceSubCategory newSubCategory)
          Updates the contents of this definition with values from the specified new defintion.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

QUERY_FIND_BY_NAME_AND_PLUGIN

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

ResourceSubCategory

public ResourceSubCategory()

ResourceSubCategory

public ResourceSubCategory(String name)
Method Detail

findTaggedResourceTypes

@NotNull
public Set<ResourceType> findTaggedResourceTypes()
Returns the resource types that belong to this subcategory; the Set of types is sorted by name.

Returns:
the resource types that belong to this subcategory; the Set of types is sorted by name

findParentResourceType

@NotNull
public ResourceType findParentResourceType()

isCreatable

public boolean isCreatable()

getId

public int getId()

setId

public void setId(int id)

getName

public String getName()

setName

public void setName(String name)

getDisplayName

public String getDisplayName()

setDisplayName

public void setDisplayName(String displayName)

getDescription

public String getDescription()

setDescription

public void setDescription(String description)

getCtime

public long getCtime()

getMtime

public long getMtime()

update

public void update(@NotNull
                   ResourceSubCategory newSubCategory)
Updates the contents of this definition with values from the specified new defintion. The intention is for this to be used as a merge between this attached instance and a detached instance. The name and resourceType will NOT be updated as part of this call; they are used as identifiers and should already be the same if this merge is being performed.

Parameters:
newSubCategory - contains new data to merge into this definition; cannot be null

removeChildSubCategory

public void removeChildSubCategory(ResourceSubCategory oldChildSubCategory)
Removes the given ResourceSubCategory as a child of this ResourceSubCategory


addChildSubCategory

public void addChildSubCategory(ResourceSubCategory childSubCategory)
add a child ResourceSubCategory to this instance


getChildSubCategories

public List<ResourceSubCategory> getChildSubCategories()

setChildSubCategories

public void setChildSubCategories(List<ResourceSubCategory> childSubCategories)

setParentSubCategory

public void setParentSubCategory(ResourceSubCategory parentSubCategory)

getParentSubCategory

public ResourceSubCategory getParentSubCategory()
Returns this subcategory's parent subcategory, or null if this subcateogry has no parent.

Returns:
this subcategory's parent subcategory, or null if this subcateogry has no parent

getResourceType

public ResourceType getResourceType()

setResourceType

public void setResourceType(ResourceType resourceType)

compareTo

public int compareTo(ResourceSubCategory that)
Specified by:
compareTo in interface Comparable<ResourceSubCategory>

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-2009 RHQ Project Advisory Board (Red Hat, Inc.). All Rights Reserved.