added type to groups

This commit is contained in:
Sebastian Sdorra
2010-09-09 17:57:02 +02:00
parent 63fdd7ad0b
commit b0f637e203
2 changed files with 42 additions and 8 deletions

View File

@@ -32,7 +32,7 @@ import javax.xml.bind.annotation.XmlType;
*/
@XmlRootElement(name = "groups")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(propOrder = { "name", "members" })
@XmlType(propOrder = { "type", "name", "members" })
public class Group implements Serializable
{
@@ -51,10 +51,13 @@ public class Group implements Serializable
* Constructs ...
*
*
*
* @param type
* @param name
*/
public Group(String name)
public Group(String type, String name)
{
this.type = type;
this.name = name;
this.members = new ArrayList<String>();
}
@@ -63,11 +66,14 @@ public class Group implements Serializable
* Constructs ...
*
*
*
* @param type
* @param name
* @param members
*/
public Group(String name, List<String> members)
public Group(String type, String name, List<String> members)
{
this.type = type;
this.name = name;
this.members = members;
}
@@ -76,11 +82,14 @@ public class Group implements Serializable
* Constructs ...
*
*
*
* @param type
* @param name
* @param members
*/
public Group(String name, String... members)
public Group(String type, String name, String... members)
{
this.type = type;
this.name = name;
this.members = new ArrayList<String>();
@@ -182,6 +191,17 @@ public class Group implements Serializable
return name;
}
/**
* Method description
*
*
* @return
*/
public String getType()
{
return type;
}
//~--- set methods ----------------------------------------------------------
/**
@@ -206,12 +226,25 @@ public class Group implements Serializable
this.name = name;
}
/**
* Method description
*
*
* @param type
*/
public void setType(String type)
{
this.type = type;
}
//~--- fields ---------------------------------------------------------------
/** Field description */
@XmlElement(name = "members")
private List<String> members;
/** Field description */
private String name;
/** Field description */
private String type;
}

View File

@@ -45,10 +45,11 @@ public class GroupResource extends AbstractResource<Group>
{
groupStore = new LinkedHashMap<String, Group>();
groupStore.put("csit",
new Group("csit", "th", "merlec", "hopper", "oelkersd",
"sdorra", "gollnict"));
new Group("static", "csit", "th", "merlec", "hopper",
"oelkersd", "sdorra", "gollnict"));
groupStore.put("devel",
new Group("devel", "sdorra", "th", "merlec", "oelkersd"));
new Group("static", "devel", "sdorra", "th", "merlec",
"oelkersd"));
}
//~--- methods --------------------------------------------------------------