fix checkstyle errs
This commit is contained in:
parent
298baf6eae
commit
19e69a1ed5
@ -39,8 +39,8 @@ import java.util.function.Consumer;
|
|||||||
/**
|
/**
|
||||||
* An action that can be executed on a panel.
|
* An action that can be executed on a panel.
|
||||||
*
|
*
|
||||||
* @param <T> the type of response expected when this action is executed
|
|
||||||
* @author Braydon
|
* @author Braydon
|
||||||
|
* @param <T> the type of response expected when this action is executed
|
||||||
*/
|
*/
|
||||||
@AllArgsConstructor(access = AccessLevel.PRIVATE)
|
@AllArgsConstructor(access = AccessLevel.PRIVATE)
|
||||||
public class PanelAction<T extends PanelModel<T>> {
|
public class PanelAction<T extends PanelModel<T>> {
|
||||||
@ -104,11 +104,11 @@ public class PanelAction<T extends PanelModel<T>> {
|
|||||||
/**
|
/**
|
||||||
* Create a new panel action.
|
* Create a new panel action.
|
||||||
*
|
*
|
||||||
* @param clientConfig the client config to use for executing actions
|
* @param clientConfig the client config to use for executing actions
|
||||||
* @param rateLimitHandler the rate limit handler to use for querying actions
|
* @param rateLimitHandler the rate limit handler to use for querying actions
|
||||||
* @param webRequest the web request to send for this action
|
* @param webRequest the web request to send for this action
|
||||||
* @param responseType the expected response type, null if none
|
* @param responseType the expected response type, null if none
|
||||||
* @param <T> the response type
|
* @param <T> the response type
|
||||||
* @return the panel action
|
* @return the panel action
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
|
@ -51,6 +51,9 @@ public final class ClientConfig {
|
|||||||
*/
|
*/
|
||||||
private final boolean debugging;
|
private final boolean debugging;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The config builder.
|
||||||
|
*/
|
||||||
public static class ClientConfigBuilder {
|
public static class ClientConfigBuilder {
|
||||||
@NonNull
|
@NonNull
|
||||||
public ClientConfigBuilder debugging(boolean state) {
|
public ClientConfigBuilder debugging(boolean state) {
|
||||||
|
@ -38,8 +38,8 @@ import java.io.Closeable;
|
|||||||
/**
|
/**
|
||||||
* A client for the API.
|
* A client for the API.
|
||||||
*
|
*
|
||||||
* @param <A> the actions for this client
|
|
||||||
* @author Braydon
|
* @author Braydon
|
||||||
|
* @param <A> the actions for this client
|
||||||
*/
|
*/
|
||||||
@Getter @Accessors(fluent = true)
|
@Getter @Accessors(fluent = true)
|
||||||
@Slf4j(topic = "Pelican4J Client")
|
@Slf4j(topic = "Pelican4J Client")
|
||||||
|
@ -30,6 +30,7 @@ import lombok.*;
|
|||||||
* A model for the panel.
|
* A model for the panel.
|
||||||
*
|
*
|
||||||
* @author Braydon
|
* @author Braydon
|
||||||
|
* @param <T> The type of the value of this model
|
||||||
*/
|
*/
|
||||||
@NoArgsConstructor @Setter @Getter @ToString
|
@NoArgsConstructor @Setter @Getter @ToString
|
||||||
public class PanelModel<T> {
|
public class PanelModel<T> {
|
||||||
|
@ -70,8 +70,8 @@ public class JsonWebRequest {
|
|||||||
*
|
*
|
||||||
* @param clientConfig the client config to use
|
* @param clientConfig the client config to use
|
||||||
* @param responseType the expected response type, null for none
|
* @param responseType the expected response type, null for none
|
||||||
* @return the response, null if none
|
|
||||||
* @param <T> the response type
|
* @param <T> the response type
|
||||||
|
* @return the response, null if none
|
||||||
*/
|
*/
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
public <T extends PanelModel<T>> T execute(@NonNull ClientConfig clientConfig, Class<T> responseType) {
|
public <T extends PanelModel<T>> T execute(@NonNull ClientConfig clientConfig, Class<T> responseType) {
|
||||||
|
@ -36,6 +36,7 @@ import java.util.function.BiConsumer;
|
|||||||
* Represents a queued action.
|
* Represents a queued action.
|
||||||
*
|
*
|
||||||
* @author Braydon
|
* @author Braydon
|
||||||
|
* @param <T> the action response type
|
||||||
*/
|
*/
|
||||||
@AllArgsConstructor(access = AccessLevel.PROTECTED) @Getter
|
@AllArgsConstructor(access = AccessLevel.PROTECTED) @Getter
|
||||||
public class QueuedAction<T extends PanelModel<T>> {
|
public class QueuedAction<T extends PanelModel<T>> {
|
||||||
|
@ -108,8 +108,8 @@ public final class RateLimitHandler {
|
|||||||
* @param callback the callback to invoke
|
* @param callback the callback to invoke
|
||||||
* @param throwRateLimitErrors whether rate limit errors should be thrown
|
* @param throwRateLimitErrors whether rate limit errors should be thrown
|
||||||
* @param retry should the action be retried if a rate limit is hit (and being thrown)?
|
* @param retry should the action be retried if a rate limit is hit (and being thrown)?
|
||||||
* @return whether the request was successful
|
|
||||||
* @param <T> the action response type
|
* @param <T> the action response type
|
||||||
|
* @return whether the request was successful
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public <T extends PanelModel<T>> boolean tryRequest(@NonNull PanelAction<?> action, BiConsumer<T, Exception> callback, boolean throwRateLimitErrors, boolean retry) {
|
public <T extends PanelModel<T>> boolean tryRequest(@NonNull PanelAction<?> action, BiConsumer<T, Exception> callback, boolean throwRateLimitErrors, boolean retry) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user