5
5
import net .dv8tion .jda .api .entities .Role ;
6
6
import net .javadiscord .javabot .Bot ;
7
7
import net .javadiscord .javabot .util .Pair ;
8
+ import org .jetbrains .annotations .NotNull ;
9
+ import org .jetbrains .annotations .Nullable ;
8
10
9
11
import java .util .Comparator ;
10
12
import java .util .Map ;
@@ -28,7 +30,7 @@ public void updateExperience(double change) {
28
30
* @param guild The current {@link Guild}.
29
31
* @return A {@link Pair} with both the Role, and the experience needed.
30
32
*/
31
- public Pair <Role , Double > getCurrentExperienceGoal (Guild guild ) {
33
+ public @ NotNull Pair <Role , Double > getCurrentExperienceGoal (Guild guild ) {
32
34
Map <Long , Double > experienceRoles = Bot .getConfig ().get (guild ).getHelpConfig ().getExperienceRoles ();
33
35
Map .Entry <Long , Double > highestExperience = Map .entry (0L , 0.0 );
34
36
for (Map .Entry <Long , Double > entry : experienceRoles .entrySet ()) {
@@ -45,7 +47,7 @@ public Pair<Role, Double> getCurrentExperienceGoal(Guild guild) {
45
47
* @param guild The current {@link Guild}.
46
48
* @return The {@link Pair} with both the Role, and the experience needed.
47
49
*/
48
- public Pair <Role , Double > getPreviousExperienceGoal (Guild guild ) {
50
+ public @ Nullable Pair <Role , Double > getPreviousExperienceGoal (Guild guild ) {
49
51
Map <Long , Double > experienceRoles = Bot .getConfig ().get (guild ).getHelpConfig ().getExperienceRoles ();
50
52
Optional <Pair <Role , Double >> experienceOptional = experienceRoles .entrySet ().stream ()
51
53
.filter (r -> r .getValue () < experience )
@@ -60,7 +62,7 @@ public Pair<Role, Double> getPreviousExperienceGoal(Guild guild) {
60
62
* @param guild The current {@link Guild}.
61
63
* @return A {@link Pair} with both the Role, and the experience needed.
62
64
*/
63
- public Pair <Role , Double > getNextExperienceGoal (Guild guild ) {
65
+ public @ NotNull Pair <Role , Double > getNextExperienceGoal (Guild guild ) {
64
66
Map <Long , Double > experienceRoles = Bot .getConfig ().get (guild ).getHelpConfig ().getExperienceRoles ();
65
67
Map .Entry <Long , Double > entry = experienceRoles .entrySet ()
66
68
.stream ()
0 commit comments