org.itracker.model
Class Component

java.lang.Object
  extended by org.itracker.model.AbstractEntity
      extended by org.itracker.model.Component
All Implemented Interfaces:
Serializable, Cloneable, Comparable<Entity>, Entity

public class Component
extends AbstractEntity
implements Comparable<Entity>

Models a project component.

A Component is a project subdivision, like a sub-project or functional area, ...
It is identified by a unique name within the project to which it belongs (composition).
e.g.: core, web-ui, swing-ui, help, ...

A component cannot have sub-components, unlike categories and sub-categories that exist in some issue tracking systems.

Author:
Jason, Johnny
See Also:
Serialized Form

Nested Class Summary
static class Component.ProjectNameComparator
           
 
Nested classes/interfaces inherited from class org.itracker.model.AbstractEntity
AbstractEntity.CreateDateComparator, AbstractEntity.IdComparator, AbstractEntity.LastModifiedDateComparator
 
Field Summary
static Comparator<Component> NAME_COMPARATOR
           
static Comparator<Component> PROJECTNAME_COMPARATOR
           
 
Fields inherited from class org.itracker.model.AbstractEntity
CREATE_DATE_COMPARATOR, ID_COMPARATOR, LAST_MODIFIED_DATE_COMPARATOR
 
Constructor Summary
Component()
          Default constructor (required by Hibernate).
Component(Project project, String name)
          Creates a new active Component of the given name for the given Project.
 
Method Summary
 String getDescription()
          Returns this component's description.
 String getName()
          Returns this component's name.
 Project getProject()
          Returns the project owning this component.
 Status getStatus()
          Returns this component's status.
 void setDescription(String description)
          Sets this component's description.
 void setName(String name)
          Sets this component's name.
 void setProject(Project project)
          Sets the project owning this component.
 void setStatus(Status status)
          Sets this component's status.
 String toString()
          Returns contatanation of system ID and object natural key.
 
Methods inherited from class org.itracker.model.AbstractEntity
clone, compareTo, equals, getCreateDate, getId, getLastModifiedDate, hashCode, isNew, setCreateDate, setId, setLastModifiedDate
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

NAME_COMPARATOR

public static final Comparator<Component> NAME_COMPARATOR

PROJECTNAME_COMPARATOR

public static final Comparator<Component> PROJECTNAME_COMPARATOR
Constructor Detail

Component

public Component()
Default constructor (required by Hibernate).

PENDING: should be private so that it can only be used by Hibernate, to ensure that project and name, which form an instance's identity, are never null.


Component

public Component(Project project,
                 String name)
Creates a new active Component of the given name for the given Project.

Parameters:
project - owning this component
name - unique component name within the project
Method Detail

getProject

public Project getProject()
Returns the project owning this component.

Returns:
parent project

setProject

public void setProject(Project project)
Sets the project owning this component.

PENDING: The project shouldn't be modified because it is part of a component's natural key and is used in the equals method!

Parameters:
project - parent project
Throws:
IllegalArgumentException - null project

getName

public String getName()
Returns this component's name.

Returns:
unique name within the parent project

setName

public void setName(String name)
Sets this component's name.

PENDING: The name shouldn't be modified because it is part of a component's natural key and is used in the equals method!

Parameters:
name - unique name within the parent project
Throws:
IllegalArgumentException - null name

getDescription

public String getDescription()
Returns this component's description.

Returns:
description

setDescription

public void setDescription(String description)
Sets this component's description.

Parameters:
description - description

getStatus

public Status getStatus()
Returns this component's status.

Returns:
enum value

setStatus

public void setStatus(Status status)
Sets this component's status.

Parameters:
status - enum value
Throws:
IllegalArgumentException - status is null

toString

public String toString()
Returns contatanation of system ID and object natural key.

Overrides:
toString in class Object
Returns:
Component [id=this.id, project=this.project, name=this.name]


Copyright © 2002-2012 itracker. All Rights Reserved.