com.soebes.subversion.sapm
Class Group

java.lang.Object
  extended by com.soebes.subversion.sapm.Group
All Implemented Interfaces:
IPrincipal

public class Group
extends Object
implements IPrincipal

A group which represents a number of individual users or groups.

Author:
Karl Heinz Marbaise

Field Summary
private  String name
          The name of the group.
private  ArrayList<IPrincipal> principalList
           
 
Constructor Summary
Group()
           
Group(String name)
           
 
Method Summary
 void add(IPrincipal principal)
          Add a new user or group to this group.
 boolean contains(String user)
          Will check to see if the given name is contained in the group if the instance represents a Group or if the given name is the same if the instance represents a single User.
 boolean contains(User user)
          Convenience method to check for a particular user in case you have the User instance instead of the user name as a string.
 String getName()
           
 ArrayList<IPrincipal> getPrincipalList()
          Get the whole list of users/groups.
private  void init()
           
 void setName(String name)
           
 void setPrincipalList(ArrayList<IPrincipal> principalList)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

principalList

private ArrayList<IPrincipal> principalList

name

private String name
The name of the group.

Constructor Detail

Group

public Group()

Group

public Group(String name)
Method Detail

init

private void init()

getName

public String getName()
Specified by:
getName in interface IPrincipal

setName

public void setName(String name)
Specified by:
setName in interface IPrincipal

add

public void add(IPrincipal principal)
Add a new user or group to this group.

Parameters:
principal - The instance either user or group.

contains

public boolean contains(User user)
Convenience method to check for a particular user in case you have the User instance instead of the user name as a string.

Parameters:
user - The User object.
Returns:
true if found false otherwise.

contains

public boolean contains(String user)
Description copied from interface: IPrincipal
Will check to see if the given name is contained in the group if the instance represents a Group or if the given name is the same if the instance represents a single User.

Specified by:
contains in interface IPrincipal
Parameters:
user - The name we check for.
Returns:
true if the name is the same or contained false otherwise.

getPrincipalList

public ArrayList<IPrincipal> getPrincipalList()
Get the whole list of users/groups.

Returns:
The list of users/groups.

setPrincipalList

public void setPrincipalList(ArrayList<IPrincipal> principalList)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2010-2011 SoftwareEntwicklung Beratung Schulung. All Rights Reserved.