mirror of
https://github.com/jwdeveloper/TikTokLiveJava.git
synced 2026-02-27 08:49:40 -05:00
Clean up code
This commit is contained in:
@@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
package io.github.jwdeveloper.tiktok.handler;
|
||||
|
||||
|
||||
import io.github.jwdeveloper.tiktok.data.events.common.TikTokEvent;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface TikTokMessageHandler
|
||||
{
|
||||
List<TikTokEvent> handle(byte[] messagePayload) throws Exception;
|
||||
}
|
||||
@@ -33,6 +33,7 @@ import java.util.List;
|
||||
public interface ListenersManager
|
||||
{
|
||||
List<TikTokEventListener> getListeners();
|
||||
|
||||
void addListener(TikTokEventListener listener);
|
||||
|
||||
void removeListener(TikTokEventListener listener);
|
||||
|
||||
@@ -28,5 +28,10 @@ import io.github.jwdeveloper.tiktok.live.LiveClient;
|
||||
@FunctionalInterface
|
||||
public interface EventConsumer<T extends TikTokEvent>
|
||||
{
|
||||
/**
|
||||
*
|
||||
* @param liveClient TikTok live client
|
||||
* @param event event data object
|
||||
*/
|
||||
void onEvent(LiveClient liveClient, T event);
|
||||
}
|
||||
|
||||
@@ -32,13 +32,18 @@ import java.util.function.Function;
|
||||
public interface TikTokMapper {
|
||||
|
||||
/**
|
||||
* * if mapper is not found for messageName, TikTokLiveException is thrown
|
||||
* when mapper is not found for messageName, TikTokLiveException is thrown
|
||||
*
|
||||
* @param messageName
|
||||
* @return TikTokMapperModel
|
||||
*/
|
||||
TikTokMapperModel forMessage(String messageName);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param mapperName protocol buffer class type
|
||||
* @return
|
||||
*/
|
||||
TikTokMapperModel forMessage(Class<? extends GeneratedMessageV3> mapperName);
|
||||
|
||||
TikTokMapperModel forMessage(String mapperName, MappingAction<MappingResult> onMapping);
|
||||
|
||||
Reference in New Issue
Block a user