added XmlGroupManager

This commit is contained in:
Sebastian Sdorra
2010-12-31 16:28:55 +01:00
parent 71aebaa26c
commit 1686ab25d0
6 changed files with 859 additions and 0 deletions

View File

@@ -38,6 +38,7 @@ package sonia.scm.group;
import sonia.scm.TypedObject;
import sonia.scm.Validateable;
import sonia.scm.util.Util;
import sonia.scm.xml.XmlTimestampDateAdapter;
//~--- JDK imports ------------------------------------------------------------
@@ -51,6 +52,7 @@ import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
/**
*
@@ -174,6 +176,99 @@ public class Group
return group;
}
/**
* Method description
*
*
* @param group
*/
public void copyProperties(Group group)
{
group.setName(name);
group.setMembers(members);
group.setType(type);
}
/**
* Method description
*
*
* @param obj
*
* @return
*/
@Override
public boolean equals(Object obj)
{
if (obj == null)
{
return false;
}
if (getClass() != obj.getClass())
{
return false;
}
final Group other = (Group) obj;
if ((this.creationDate != other.creationDate)
&& ((this.creationDate == null)
||!this.creationDate.equals(other.creationDate)))
{
return false;
}
if ((this.members != other.members)
&& ((this.members == null) ||!this.members.equals(other.members)))
{
return false;
}
if ((this.name == null)
? (other.name != null)
: !this.name.equals(other.name))
{
return false;
}
if ((this.type == null)
? (other.type != null)
: !this.type.equals(other.type))
{
return false;
}
return true;
}
/**
* Method description
*
*
* @return
*/
@Override
public int hashCode()
{
int hash = 5;
hash = 89 * hash + ((this.creationDate != null)
? this.creationDate.hashCode()
: 0);
hash = 89 * hash + ((this.members != null)
? this.members.hashCode()
: 0);
hash = 89 * hash + ((this.name != null)
? this.name.hashCode()
: 0);
hash = 89 * hash + ((this.type != null)
? this.type.hashCode()
: 0);
return hash;
}
/**
* Method description
*
@@ -232,6 +327,17 @@ public class Group
//~--- get methods ----------------------------------------------------------
/**
* Method description
*
*
* @return
*/
public Long getCreationDate()
{
return creationDate;
}
/**
* Method description
*
@@ -285,6 +391,17 @@ public class Group
//~--- set methods ----------------------------------------------------------
/**
* Method description
*
*
* @param creationDate
*/
public void setCreationDate(Long creationDate)
{
this.creationDate = creationDate;
}
/**
* Method description
*
@@ -320,6 +437,10 @@ public class Group
//~--- fields ---------------------------------------------------------------
/** Field description */
@XmlJavaTypeAdapter(XmlTimestampDateAdapter.class)
private Long creationDate;
/** Field description */
private List<String> members;