Package de.murmelmeister.murmelapi.group
Class GroupProvider
java.lang.Object
de.murmelmeister.murmelapi.group.GroupProvider
- All Implemented Interfaces:
Group
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final GroupColorSettingsprivate final GroupParentprivate final GroupPermissionprivate final GroupSettings -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate intvoidcreateNewGroup(String name, int creatorId, int sortId, String teamId) Creates a new group and checks if the group already exists.private voidcreateTable(String tableName) voiddeleteGroup(int id) Deletes a group.booleanexistsGroup(int id) Checks if a group exists.booleanexistsGroup(String name) Checks if a group exists.Obtains the color settings of a group.intObtains the default group.getName(int id) Obtains the name of a group.getNames()Obtains a list of all names of the groups.Obtains the parent of a group.Obtains the permission of a group.Obtains the settings of a group.intgetUniqueId(String name) Obtains the unique id of a group.Obtains a list of all unique ids of the groups.voidLoads all expired things.voidRenames a group.voidRenames a group.
-
Field Details
-
settings
-
colorSettings
-
parent
-
permission
-
-
Constructor Details
-
GroupProvider
public GroupProvider()
-
-
Method Details
-
createTable
-
existsGroup
public boolean existsGroup(int id) Description copied from interface:GroupChecks if a group exists.- Specified by:
existsGroupin interfaceGroup- Parameters:
id- The id of the group.- Returns:
- True if the group exists, otherwise false.
-
existsGroup
Description copied from interface:GroupChecks if a group exists.- Specified by:
existsGroupin interfaceGroup- Parameters:
name- The name of the group.- Returns:
- True if the group exists, otherwise false.
-
createNewGroup
Description copied from interface:GroupCreates a new group and checks if the group already exists. If the group already exists, the method will return without creating a new group.- Specified by:
createNewGroupin interfaceGroup- Parameters:
name- The name of the group.creatorId- The creator id of the group.sortId- The sort id of the group.teamId- The team id of the group.
-
deleteGroup
public void deleteGroup(int id) Description copied from interface:GroupDeletes a group.- Specified by:
deleteGroupin interfaceGroup- Parameters:
id- The id of the group.
-
getUniqueId
Description copied from interface:GroupObtains the unique id of a group.- Specified by:
getUniqueIdin interfaceGroup- Parameters:
name- The name of the group.- Returns:
- The unique id of the group.
-
getName
Description copied from interface:GroupObtains the name of a group. -
rename
Description copied from interface:GroupRenames a group. -
rename
Description copied from interface:GroupRenames a group. -
getUniqueIds
Description copied from interface:GroupObtains a list of all unique ids of the groups.- Specified by:
getUniqueIdsin interfaceGroup- Returns:
- A list of all unique ids of the groups.
-
getNames
Description copied from interface:GroupObtains a list of all names of the groups. -
loadExpired
public void loadExpired()Description copied from interface:GroupLoads all expired things.- Specified by:
loadExpiredin interfaceGroup
-
createDefaultGroup
private int createDefaultGroup() -
getDefaultGroup
public int getDefaultGroup()Description copied from interface:GroupObtains the default group. The default group is the group with the id 1.- Specified by:
getDefaultGroupin interfaceGroup
-
getSettings
Description copied from interface:GroupObtains the settings of a group.- Specified by:
getSettingsin interfaceGroup- Returns:
- The settings of the group.
-
getColorSettings
Description copied from interface:GroupObtains the color settings of a group.- Specified by:
getColorSettingsin interfaceGroup- Returns:
- The color settings of the group.
-
getParent
Description copied from interface:GroupObtains the parent of a group. -
getPermission
Description copied from interface:GroupObtains the permission of a group.- Specified by:
getPermissionin interfaceGroup- Returns:
- The permission of the group.
-