Package com.logicaldoc.core.security.user

# Class Group

java.lang.Object
com.logicaldoc.core.PersistentObject
com.logicaldoc.core.security.user.Group

All Implemented Interfaces:
  `Serializable`

@Entity public class Group extends PersistentObject implements Serializable
This class represents groups.
Groups have a type that qualifies the group usage as follows:

- DEFAULT (0): Standard group of users
- USER (1): Group of a user(one to one relationship), it is hidden and not editable using admin tools

Version:
  1.0
Author:
  Michael Scholz, Marco Meschieri
See Also:
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`GROUP_ADMIN`
`static final long`
`GROUPID_ADMIN`
`static final long`
`GROUPID_PUBLISHER`

### Fields inherited from class com.logicaldoc.core.PersistentObject

`DELETED_CODE_DEFAULT, DELETED_CODE_STRONG, id`

## Constructor Summary

Constructors
Constructor
Description
`Group()`

## Method Summary

Modifier and Type
Method
Description
`void`
`clearUsers()`
`boolean`
`equals(Object obj)`
`String`
`getDescription()`
`String`
`getName()`
`String`
`getSource()`
`GroupType`
`getType()`
`User`
`getUser()`
If this is a user group, then it returns the user
`Set<User>`
`getUsers()`
`int`
`hashCode()`
`boolean`
`isAdmin()`
`boolean`
`isGuest()`
Check if this group is the guest or is the user's group of a guest user
`boolean`
`isUserGroup()`
`void`
`reset()`
`void`
`setDescription(String description)`
`void`
`setName(String name)`
`void`
`setSource(String source)`
`void`
`setType(int type)`
`void`
`setType(GroupType type)`
`void`
`setUsers(Set<User> users)`
`String`
`toString()`

### Methods inherited from class com.logicaldoc.core.PersistentObject

`getCreation, getDeleted, getId, getLastModified, getRecordVersion, getTenantId, setCreation, setDeleted, setId, setLastModified, setRecordVersion, setTenantId`

### Methods inherited from class java.lang.Object

`getClass, notify, notifyAll, wait, wait, wait`

## Field Details

### GROUP_ADMIN

public static final String GROUP_ADMIN

See Also:
  - Constant Field Values

### GROUPID_ADMIN

public static final long GROUPID_ADMIN

See Also:
  - Constant Field Values

### GROUPID_PUBLISHER

public static final long GROUPID_PUBLISHER

See Also:
  - Constant Field Values

## Constructor Details

### Group

public Group()

## Method Details

### getType

public GroupType getType()

### setType

public void setType(GroupType type)

### setType

public void setType(int type)

### getUsers

public Set<User> getUsers()

### setUsers

public void setUsers(Set<User> users)

### getName

public String getName()

### getDescription

public String getDescription()

### setName

public void setName(String name)

### setDescription

public void setDescription(String description)

### reset

public void reset()

### clearUsers

public void clearUsers()

### toString

public String toString()

Overrides:
  `toString` in class `PersistentObject`

### isUserGroup

public boolean isUserGroup()

### getUser

public User getUser()
If this is a user group, then it returns the user

Returns:
  the user

### isGuest

public boolean isGuest()
Check if this group is the guest or is the user's group of a guest user

Returns:
  if this is the guest group or is the user's group of a guest user

### isAdmin

public boolean isAdmin()

### getSource

public String getSource()

### setSource

public void setSource(String source)

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `PersistentObject`

### equals

public boolean equals(Object obj)

Overrides:
  `equals` in class `PersistentObject`