Renamed Priority.priorityValue to value to follow enum standards

Clarified message in TikTokEventListener
This commit is contained in:
kohlerpop1
2024-07-03 21:04:44 -04:00
parent 36475c2cf6
commit 316868818b
3 changed files with 5 additions and 6 deletions

View File

@@ -1,4 +1,5 @@
package io.github.jwdeveloper.tiktok.annotations;
/**
* HIGHEST 1
* HIGH 2
@@ -6,13 +7,12 @@ package io.github.jwdeveloper.tiktok.annotations;
* LOW 4
* LOWEST 5
*/
public enum Priority {
LOWEST(2), LOW(1), NORMAL(0), HIGH(-1), HIGHEST(-2);
public int priorityValue;
public final int value;
Priority(int value) {
this.priorityValue = value;
this.value = value;
}
}

View File

@@ -69,7 +69,7 @@ import io.github.jwdeveloper.tiktok.live.LiveClient;
*/
//TODO I think this interface can be removed, since we are using,
//annotation @TikTokEventHandler to check methods that are events
@Deprecated(forRemoval = true, since = "This interface is not longer needed, please remove it from your class")
@Deprecated(forRemoval = true, since = "1.8.1 (This interface is not longer needed, please remove it from your class)")
public interface TikTokEventListener {
}

View File

@@ -28,7 +28,6 @@ import io.github.jwdeveloper.tiktok.annotations.TikTokEventObserver;
import io.github.jwdeveloper.tiktok.data.events.common.TikTokEvent;
import io.github.jwdeveloper.tiktok.exceptions.TikTokEventListenerMethodException;
import io.github.jwdeveloper.tiktok.exceptions.TikTokLiveException;
import io.github.jwdeveloper.tiktok.live.LiveClient;
import io.github.jwdeveloper.tiktok.live.LiveEventsHandler;
import io.github.jwdeveloper.tiktok.live.builder.EventConsumer;
@@ -89,7 +88,7 @@ public class TikTokListenersManager implements ListenersManager {
.filter(e -> e.isAnnotationPresent(TikTokEventObserver.class))
.filter(e -> e.getParameterCount() >= 1)
.map(method -> getSingleMethodInfo(listener, method))
.sorted(Comparator.comparingInt(a -> a.getPriority().priorityValue))
.sorted(Comparator.comparingInt(a -> a.getPriority().value))
.toList();
}