55import net .dv8tion .jda .api .entities .Role ;
66import net .javadiscord .javabot .Bot ;
77import net .javadiscord .javabot .util .Pair ;
8+ import org .jetbrains .annotations .NotNull ;
9+ import org .jetbrains .annotations .Nullable ;
810
911import java .util .Comparator ;
1012import java .util .Map ;
@@ -28,7 +30,7 @@ public void updateExperience(double change) {
2830 * @param guild The current {@link Guild}.
2931 * @return A {@link Pair} with both the Role, and the experience needed.
3032 */
31- public Pair <Role , Double > getCurrentExperienceGoal (Guild guild ) {
33+ public @ NotNull Pair <Role , Double > getCurrentExperienceGoal (Guild guild ) {
3234 Map <Long , Double > experienceRoles = Bot .getConfig ().get (guild ).getHelpConfig ().getExperienceRoles ();
3335 Map .Entry <Long , Double > highestExperience = Map .entry (0L , 0.0 );
3436 for (Map .Entry <Long , Double > entry : experienceRoles .entrySet ()) {
@@ -45,7 +47,7 @@ public Pair<Role, Double> getCurrentExperienceGoal(Guild guild) {
4547 * @param guild The current {@link Guild}.
4648 * @return The {@link Pair} with both the Role, and the experience needed.
4749 */
48- public Pair <Role , Double > getPreviousExperienceGoal (Guild guild ) {
50+ public @ Nullable Pair <Role , Double > getPreviousExperienceGoal (Guild guild ) {
4951 Map <Long , Double > experienceRoles = Bot .getConfig ().get (guild ).getHelpConfig ().getExperienceRoles ();
5052 Optional <Pair <Role , Double >> experienceOptional = experienceRoles .entrySet ().stream ()
5153 .filter (r -> r .getValue () < experience )
@@ -60,7 +62,7 @@ public Pair<Role, Double> getPreviousExperienceGoal(Guild guild) {
6062 * @param guild The current {@link Guild}.
6163 * @return A {@link Pair} with both the Role, and the experience needed.
6264 */
63- public Pair <Role , Double > getNextExperienceGoal (Guild guild ) {
65+ public @ NotNull Pair <Role , Double > getNextExperienceGoal (Guild guild ) {
6466 Map <Long , Double > experienceRoles = Bot .getConfig ().get (guild ).getHelpConfig ().getExperienceRoles ();
6567 Map .Entry <Long , Double > entry = experienceRoles .entrySet ()
6668 .stream ()
0 commit comments