com.rapidtransform.part.model
Class Item

java.lang.Object
  extended by com.rapidtransform.core.model.AbstractBaseModel
      extended by com.rapidtransform.core.model.VersionControlled
          extended by com.rapidtransform.part.model.Item
All Implemented Interfaces:
Classified, Model, Versioned, OrganizationalData, OrganizationElement, Effective, java.io.Serializable

public class Item
extends VersionControlled
implements Classified, OrganizationElement, OrganizationalData, Effective

An item is either a single object or an assembly of related objects. The item can be classified as either a part, raw material, tool or assebly using the SpecificItemClassification object.

Author:
Steve Werner
See Also:
Serialized Form

Constructor Summary
Item()
          Default constructor
Item(java.lang.String name)
          Constructs an Item with the given name and creates the first version for the list of ItemVersions.
 
Method Summary
 void addItemVersion(ItemVersion newVersion)
          Adds a new ItemVersion to the list of ItemVersions for this Item
 ItemVersion createNewVersion()
          Creates new version of this Item, adds it to the ItemVersions list, and returns the new ItemVersion object.
 boolean equals(java.lang.Object other)
          override equals since this object could be used in a Collection
 java.util.Collection<Alias> getAliases()
           
 java.lang.String getDescription()
           
 java.util.Collection<Document> getDocuments()
           
 java.util.Collection<ItemVersion> getItemVersions()
           
 ItemVersion getLatestVersion()
          Returns the concept of a latest version out of the list of ItemVersions for this Item.
 java.lang.String getName()
           
 int hashCode()
          Override hashCode since this object could be used in a Collection
 void setAliases(java.util.Set<Alias> aliases)
           
 void setDescription(java.lang.String description)
           
 void setDocuments(java.util.Set<Document> documents)
           
 void setItemVersions(java.util.Set<ItemVersion> itemVersions)
           
 void setName(java.lang.String name)
           
 
Methods inherited from class com.rapidtransform.core.model.VersionControlled
getCreatedBy, getCreatedDate, getIteration, getModifiedBy, getModifiedDate, setCreatedBy, setCreatedDate, setIteration, setModifiedBy, setModifiedDate
 
Methods inherited from class com.rapidtransform.core.model.AbstractBaseModel
generateUuid, getId, getMetaTypeName, getPropertyHolder, getUuid, setId, setMetaTypeName, setPropertyHolder, setUuid
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Item

public Item()
Default constructor


Item

public Item(java.lang.String name)
Constructs an Item with the given name and creates the first version for the list of ItemVersions.

Parameters:
name -
Method Detail

getAliases

public java.util.Collection<Alias> getAliases()
Returns:
Returns the alias.

setAliases

public void setAliases(java.util.Set<Alias> aliases)
Parameters:
alias - The alias to set.

getDescription

public java.lang.String getDescription()
Returns:
Returns the description.

setDescription

public void setDescription(java.lang.String description)
Parameters:
description - The description to set.

getName

public java.lang.String getName()
Returns:
Returns the name.

setName

public void setName(java.lang.String name)
Parameters:
name - The name to set.

getDocuments

public java.util.Collection<Document> getDocuments()
Returns:
Returns the documents.

setDocuments

public void setDocuments(java.util.Set<Document> documents)
Parameters:
documents - The documents to set.

getItemVersions

public java.util.Collection<ItemVersion> getItemVersions()
Returns:
Returns the itemVersions.

setItemVersions

public void setItemVersions(java.util.Set<ItemVersion> itemVersions)
Parameters:
itemVersions - The itemVersions to set.

addItemVersion

public void addItemVersion(ItemVersion newVersion)
Adds a new ItemVersion to the list of ItemVersions for this Item

Parameters:
newVersion -

createNewVersion

public ItemVersion createNewVersion()
Creates new version of this Item, adds it to the ItemVersions list, and returns the new ItemVersion object. The ItemVersion object will automatically have this Item set as it's parent Item.

Returns:
ItemVersion The new item version.

getLatestVersion

public ItemVersion getLatestVersion()
Returns the concept of a latest version out of the list of ItemVersions for this Item. The latest version is defined as the last version that was created for this Item - that is, the ItemVersion with the highest versionId.

Returns:
Latest ItemVersion

equals

public boolean equals(java.lang.Object other)
override equals since this object could be used in a Collection

Overrides:
equals in class AbstractBaseModel

hashCode

public int hashCode()
Override hashCode since this object could be used in a Collection

Overrides:
hashCode in class AbstractBaseModel