org.aspsimon.termcomp.entity
Class Team

java.lang.Object
  extended by org.aspsimon.termcomp.entity.Team
All Implemented Interfaces:
java.io.Serializable

public class Team
extends java.lang.Object
implements java.io.Serializable

This class represents a Team. A team has multiple members and can maintain 0..* tools.

Version:
$Revision: 104 $
Author:
binabik
See Also:
Serialized Form

Constructor Summary
Team()
           
 
Method Summary
 java.lang.String getDirectory()
          As it cannot be guaranteed that the transliteration of a team's name is unique (unlike the team name), this method is a convenience method to append the teamId to the normalizedName, thus resulting in a unique directory name (the teamId is unique by definition).
 java.lang.String getNormalizedName()
          Return the non-internationalized representation of this team's name.
 java.sql.Timestamp getRegisteredDate()
          Get the date this Team was first registered.
 User getTeamCaptain()
          Get the team captain.
 java.lang.Long getTeamId()
          Get the unique identifier for this Team.
 java.util.List<User> getTeamMembers()
          Return a list of Users who are members of this team.
 java.lang.String getTeamName()
          Get the team name.
 java.util.List<Tool> getTools()
          Return a list of Tools maintained by this team.
 void prePersist()
          Hibernate lifecycle convenience method.
 void setNormalizedName(java.lang.String normalizedName)
          Set the normalized name for this team.
 void setRegisteredDate(java.sql.Timestamp registeredDate)
          Set the date and time this team was created.
 void setTeamCaptain(User teamCaptain)
          Set the team captain.
 void setTeamId(java.lang.Long teamId)
          Set the identifier.
 void setTeamMembers(java.util.List<User> teamMembers)
          Set the list of team members.
 void setTeamName(java.lang.String teamName)
          Set the team name.
 void setTools(java.util.List<Tool> tools)
          Set the list of Tools maintained by this team.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Team

public Team()
Method Detail

getTeamId

public java.lang.Long getTeamId()
Get the unique identifier for this Team.

Returns:
A DB-generated identifier for internally referencing this Team. Globally unique.

getTeamName

@NotNull
public java.lang.String getTeamName()
Get the team name.

Returns:
The team name supplied by the creator of this team.

getTeamCaptain

public User getTeamCaptain()
Get the team captain. This is initially the creator of the team. The creator of the team can delegate his captaincy to another member.

Returns:
The User object representing the team captain.

getTeamMembers

public java.util.List<User> getTeamMembers()
Return a list of Users who are members of this team. The team captain has to approve the membership of a user.

Returns:
The list of team members.

getTools

public java.util.List<Tool> getTools()
Return a list of Tools maintained by this team.

Returns:
The Tools maintained by this team.

getRegisteredDate

public java.sql.Timestamp getRegisteredDate()
Get the date this Team was first registered.

Returns:
The date this team was created.

getNormalizedName

public java.lang.String getNormalizedName()
Return the non-internationalized representation of this team's name. This is used for the directory under which all the team's files are stored. The normalized name can be set with {@link I18NHelper#normalizeString(String)}. German umlauts (ä, ö, ü) are converted to 'ae', 'oe' and 'ue' respectively, spaces are replaced by '_' and the whole string is in lower case. Punctuation is converted to a hyphen ('-').

Returns:
The normalized representation of this team name.

getDirectory

public java.lang.String getDirectory()
As it cannot be guaranteed that the transliteration of a team's name is unique (unlike the team name), this method is a convenience method to append the teamId to the normalizedName, thus resulting in a unique directory name (the teamId is unique by definition).

Returns:
A string consisting of the normalized name, followed by an underscore ("_") and the team identifier in the database.

setTeamId

public void setTeamId(java.lang.Long teamId)
Set the identifier.

Parameters:
teamId - The globally unique identifier for this Team.

setTeamName

public void setTeamName(java.lang.String teamName)
Set the team name.

Parameters:
teamName - The team name to set.

setTeamCaptain

public void setTeamCaptain(User teamCaptain)
Set the team captain. Only the team captain can change this.

Parameters:
teamCaptain - The User nominated as captain.

setTeamMembers

public void setTeamMembers(java.util.List<User> teamMembers)
Set the list of team members.

Parameters:
teamMembers - The list of Users who are members of this team.

setTools

public void setTools(java.util.List<Tool> tools)
Set the list of Tools maintained by this team.

Parameters:
tools - The list of Tools.

setRegisteredDate

public void setRegisteredDate(java.sql.Timestamp registeredDate)
Set the date and time this team was created.

Parameters:
registeredDate - The date and time when a user created this team.

setNormalizedName

public void setNormalizedName(java.lang.String normalizedName)
Set the normalized name for this team.

Parameters:
normalizedName - The name to set which should be lower case, not contain spaces and be a subset of US-ASCII.

prePersist

public void prePersist()
Hibernate lifecycle convenience method.