Class GroupUtil
java.lang.Object
ntnu.idatt2016.v233.SmartMat.util.GroupUtil
This class provide some useful methods used with the group entity.
- Version:
- 1.0
- Author:
- Pedro Cardona
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Generates a unique six-digit code using UUID.static int
getLevel
(long exp) Calculates the level of a group based on its experience points.static int
getProgressOfLevel
(long exp) Calculates the progress of the current level of a group based on its experience points.
-
Constructor Details
-
GroupUtil
public GroupUtil()
-
-
Method Details
-
getLevel
public static int getLevel(long exp) Calculates the level of a group based on its experience points.- Parameters:
exp
- The experience points of the group.- Returns:
- The level of the group.
-
getProgressOfLevel
public static int getProgressOfLevel(long exp) Calculates the progress of the current level of a group based on its experience points.- Parameters:
exp
- The experience points of the group.- Returns:
- The progress of the current level of the group as a percentage.
-
generateUniqueCode
Generates a unique six-digit code using UUID.- Returns:
- A unique six-digit code.
-