pl.edu.agh.cast.importer.base.template
Class ImportTemplateGroup

java.lang.Object
  extended by pl.edu.agh.cast.importer.base.template.ImportTemplateGroup
All Implemented Interfaces:
Serializable

public class ImportTemplateGroup
extends Object
implements Serializable

Class which groups IImportTemplate objects. Each group has name and description and a list of children import templates.

Author:
AGH CAST Team
See Also:
Serialized Form

Constructor Summary
ImportTemplateGroup()
          Default constructor which generates random id.
 
Method Summary
 boolean addTemplate(IImportTemplate template)
          Add template to this group.
 boolean addTemplate(UUID templateId)
          Add template with given id to this group.
 boolean containsTemplate(IImportTemplate template)
          Checks if a given template belongs to this group.
 boolean containsTemplate(UUID templateId)
          Checks if a template with given id belongs to this group.
 String getDescription()
           
 UUID getId()
           
 String getName()
           
 Set<UUID> getTemplates()
           
 boolean isDefaultGroup()
           
 boolean isEmpty()
          Checks if group has any templates.
 boolean removeTemplate(UUID templateId)
          Removes template with given id from this group.
 void setDefaultGroup(boolean defaultGroup)
           
 void setDescription(String description)
          Sets group description.
 void setName(String name)
          Sets group name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImportTemplateGroup

public ImportTemplateGroup()
Default constructor which generates random id.

Method Detail

getId

public UUID getId()

getName

public String getName()

setName

public void setName(String name)
Sets group name.

Parameters:
name - a new group name

getDescription

public String getDescription()

setDescription

public void setDescription(String description)
Sets group description.

Parameters:
description - group description

getTemplates

public Set<UUID> getTemplates()

addTemplate

public boolean addTemplate(IImportTemplate template)
Add template to this group.

Parameters:
template - template to add
Returns:
true if template wasn't in the group before

addTemplate

public boolean addTemplate(UUID templateId)
Add template with given id to this group.

Parameters:
templateId - template id to add
Returns:
true if template wasn't in the group before

removeTemplate

public boolean removeTemplate(UUID templateId)
Removes template with given id from this group.

Parameters:
templateId - id of template to remove
Returns:
true if template with given id existed in this group

containsTemplate

public boolean containsTemplate(IImportTemplate template)
Checks if a given template belongs to this group.

Parameters:
template - template
Returns:
true if template belongs to this group

containsTemplate

public boolean containsTemplate(UUID templateId)
Checks if a template with given id belongs to this group.

Parameters:
templateId - template id
Returns:
true if template belongs to this group

isEmpty

public boolean isEmpty()
Checks if group has any templates.

Returns:
true if this group contains at least one template

isDefaultGroup

public boolean isDefaultGroup()

setDefaultGroup

public void setDefaultGroup(boolean defaultGroup)


Copyright © 2007-2009 IISG AGH-UST Krakow, Poland. All Rights Reserved.