Class Group
- java.lang.Object
-
- org.opennms.web.admin.groups.parsers.Group
-
- All Implemented Interfaces:
java.lang.Cloneable
public class Group extends java.lang.Object implements java.lang.Cloneable
This is a data class to store the group information from the groups.xml file- Since:
- 1.8.1
- Version:
- 1.1.1.1
- Author:
- Jason Johns , OpenNMS , Jason Johns , OpenNMS
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
GROUP_NAME_PROPERTY
-
Constructor Summary
Constructors Constructor Description Group()
Default constructor, initializes the users list
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListenervoid
addUser(java.lang.String aUser)
Adds a username to the list of usersvoid
clearUsers()
Removes all users from the group.Group
clone()
clonejava.lang.String
getGroupComments()
Returns the comments for the groupGroupInfo
getGroupInfo()
Returns the group information for this groupjava.lang.String
getGroupName()
Returns the group nameint
getUserCount()
Returns a count of the users in the listjava.util.List<java.lang.String>
getUsers()
Returns the list of usersboolean
hasUser(java.lang.String aUser)
Returns whether the group has this user in its users listvoid
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListenervoid
removeUser(java.lang.String aUser)
Removes a username from the list of usersvoid
setGroupComments(java.lang.String someComments)
Sets the comments for the groupvoid
setGroupInfo(GroupInfo someInfo)
Sets the group information for this groupvoid
setGroupName(java.lang.String aName)
Sets the group namejava.lang.String
toString()
Returns a String representation of the group, used primarily for debugging.
-
-
-
Field Detail
-
GROUP_NAME_PROPERTY
public static final java.lang.String GROUP_NAME_PROPERTY
- See Also:
- Constant Field Values
-
-
Method Detail
-
clone
public Group clone()
clone
- Overrides:
clone
in classjava.lang.Object
- Returns:
- a
Group
object.
-
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener
- Parameters:
listener
- aPropertyChangeListener
object.
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener
- Parameters:
listener
- aPropertyChangeListener
object.
-
getGroupInfo
public GroupInfo getGroupInfo()
Returns the group information for this group- Returns:
- the group info
-
setGroupInfo
public void setGroupInfo(GroupInfo someInfo)
Sets the group information for this group- Parameters:
someInfo
- the group info
-
setGroupName
public void setGroupName(java.lang.String aName)
Sets the group name- Parameters:
aName
- the name of the group
-
getGroupName
public java.lang.String getGroupName()
Returns the group name- Returns:
- the name of the group
-
setGroupComments
public void setGroupComments(java.lang.String someComments)
Sets the comments for the group- Parameters:
someComments
- the comments for the group
-
getGroupComments
public java.lang.String getGroupComments()
Returns the comments for the group- Returns:
- the comments for the group
-
hasUser
public boolean hasUser(java.lang.String aUser)
Returns whether the group has this user in its users list- Parameters:
aUser
- aString
object.- Returns:
- true if user is in list, false if not
-
addUser
public void addUser(java.lang.String aUser)
Adds a username to the list of users- Parameters:
aUser
- a new username
-
removeUser
public void removeUser(java.lang.String aUser)
Removes a username from the list of users- Parameters:
aUser
- the user to remove
-
clearUsers
public void clearUsers()
Removes all users from the group.
-
getUsers
public java.util.List<java.lang.String> getUsers()
Returns the list of users- Returns:
- the list of users
-
getUserCount
public int getUserCount()
Returns a count of the users in the list- Returns:
- how many users in this group
-
toString
public java.lang.String toString()
Returns a String representation of the group, used primarily for debugging.- Overrides:
toString
in classjava.lang.Object
- Returns:
- a string representation
-
-