Class Fluxpoint4J

    • Constructor Detail

      • Fluxpoint4J

        public Fluxpoint4J()
    • Method Detail

      • setToken

        public void setToken​(@NotNull
                             @NotNull java.lang.String token)
        Sets the API token to use for the Fluxpoint API.
        Parameters:
        token - The API token to use.
      • getCustomImage

        @Nullable
        public @Nullable GenericAPIResponse getCustomImage​(@NotNull
                                                           @NotNull CustomImage image)
        Generates a custom image using the provided CustomImage instance.

        The returned GenericAPIResponse can be one of two instances:

        to see if the request was successful or not can you do this simple check:
        
         GenericAPIResponse response = getCustomImage(someCustomImage);
        
         if(response instanceof FailedAPIResponse){
             // The request was not successful!
             System.out.println("Request failed!");
             return;
         }
        
         // Request was successful. Response is a GeneratedImage instance!
         GeneratedImage image = (GeneratedImage)response;
         
        Parameters:
        image - The CustomImage to generate.
        Returns:
        GenericAPIResponse that is either the GeneratedImage or FailedAPIResponse instance.
      • queueCustomImage

        public java.util.concurrent.CompletableFuture<GenericAPIResponse> queueCustomImage​(@NotNull
                                                                                           @NotNull CustomImage image)
        Calls getCustomImage(CustomImage) and wraps it into a CompletableFuture<GenericAPIResponse> for you to use.

        The returned GenericAPIResponse can be one of two instances:

        to see if the request was successful or not can you do this simple check:
        
         GenericAPIResponse response = getCustomImage(someCustomImage);
        
         if(response instanceof FailedAPIResponse){
             // The request was not successful!
             System.out.println("Request failed!");
             return;
         }
        
         // Request was successful. Response is a GeneratedImage instance!
         GeneratedImage image = (GeneratedImage)response;
         
        Parameters:
        image - The CustomImage to generate.
        Returns:
        CompletableFuture with a GenericAPIResponse instance.
        See Also:
        getCustomImage
      • getWelcomeImage

        @Nullable
        public @Nullable GenericAPIResponse getWelcomeImage​(@NotNull
                                                            @NotNull WelcomeImage image)
        Generates a Welcome image using the provided WelcomeImage instance.

        The returned GenericAPIResponse can be one of two instances:

        to see if the request was successful or not can you do this simple check:
        
         GenericAPIResponse response = getWelcomeImage(someWelcomeImage);
        
         if(response instanceof FailedAPIResponse){
             // The request was not successful!
             System.out.println("Request failed!");
             return;
         }
        
         // Request was successful. Response is a GeneratedImage instance!
         GeneratedImage image = (GeneratedImage)response;
         
        Parameters:
        image - The WelcomeImage to generate.
        Returns:
        GenericAPIResponse that is either the GeneratedImage or a failed API response.
      • queueWelcomeImage

        public java.util.concurrent.CompletableFuture<GenericAPIResponse> queueWelcomeImage​(@NotNull
                                                                                            @NotNull WelcomeImage image)
        Calls getWelcomeImage(WelcomeImage) and wraps it into a CompletableFuture<GeneratedImage> for you to use.

        The returned GenericAPIResponse can be one of two instances:

        to see if the request was successful or not can you do this simple check:
        
         GenericAPIResponse response = getWelcomeImage(someWelcomeImage);
        
         if(response instanceof FailedAPIResponse){
             // The request was not successful!
             System.out.println("Request failed!");
             return;
         }
        
         // Request was successful. Response is a GeneratedImage instance!
         GeneratedImage image = (GeneratedImage)response;
         
        Parameters:
        image - The WelcomeImage to generate.
        Returns:
        CompletableFuture with a GenericAPIResponse instance.
        See Also:
        getWelcomeImage
      • getNewMCRequestBuilder

        public MCRequestBuilder getNewMCRequestBuilder()
        Creates and returns a new instance of the MCRequestBuilder to use, which allows you to set various things in the request such as domain, port and if icon should be included.
        Returns:
        A new, usable instance of MCRequestBuilder.
      • getMCServerInfo

        @Deprecated
        public GenericAPIResponse getMCServerInfo​(@NotNull
                                                  @NotNull java.lang.String host)
        Deprecated.
        Use the new Builder instead.
        Performs a request to the Fluxpoint API to check a Server and receive possible information from it.
        This particular method will ping the server with the default port 25565. If you want to set a own port, use getMCServerInfo(String, int) instead.

        The returned GenericAPIResponse can be one of two instances:

        to see if the request was successful or not can you do this simple check:
        
         GenericAPIResponse response = getMCServerInfo("mc.example.com");
        
         if(response instanceof FailedAPIResponse){
             // The request was not successful!
             System.out.println("Request failed!");
             return;
         }
        
         // Request was successful. Response is a MCServerPingResponse instance!
         GeneratedImage image = (MCServerPingResponse)response;
         
        Parameters:
        host - The server to ping. This can be a domain or IP.
        Returns:
        GenericAPIResponse that is either a MCServerPingResponse or FailedAPIResponse instance.
        See Also:
        getMCServerInfo
      • getMCServerInfo

        @Deprecated
        public GenericAPIResponse getMCServerInfo​(@NotNull
                                                  @NotNull java.lang.String host,
                                                  int port)
        Deprecated.
        Use the new Builder instead.
        Performs a request to the Fluxpoint API to check a Server and receive possible information from it.

        The returned GenericAPIResponse can be one of two instances:

        to see if the request was successful or not can you do this simple check:
        
         GenericAPIResponse response = getMCServerInfo("mc.example.com");
        
         if(response instanceof FailedAPIResponse){
             // The request was not successful!
             System.out.println("Request failed!");
             return;
         }
        
         // Request was successful. Response is a MCServerPingResponse instance!
         GeneratedImage image = (MCServerPingResponse)response;
         
        Parameters:
        host - The server to ping. This can be a domain or IP.
        port - The port to ping the server on.
        Returns:
        GenericAPIResponse that is either a MCServerPingResponse or FailedAPIResponse instance.
      • queueMCServerInfo

        @Deprecated
        public java.util.concurrent.CompletableFuture<GenericAPIResponse> queueMCServerInfo​(@NotNull
                                                                                            @NotNull java.lang.String host)
        Deprecated.
        Use the new Builder instead.
        Calls getMCServerInfo(String) and wraps it into a CompletableFuture<GeneratedImage> for you to use.

        The returned GenericAPIResponse can be one of two instances:

        to see if the request was successful or not can you do this simple check:
        
         GenericAPIResponse response = getMCServerInfo("mc.example.com");
        
         if(response instanceof FailedAPIResponse){
             // The request was not successful!
             System.out.println("Request failed!");
             return;
         }
        
         // Request was successful. Response is a MCServerPingResponse instance!
         GeneratedImage image = (MCServerPingResponse)response;
         
        Parameters:
        host - The server to ping. This can be a domain or IP.
        Returns:
        GenericAPIResponse that is either a MCServerPingResponse or FailedAPIResponse instance.
        See Also:
        getMCServerInfo
      • queueMCServerInfo

        @Deprecated
        public java.util.concurrent.CompletableFuture<GenericAPIResponse> queueMCServerInfo​(@NotNull
                                                                                            @NotNull java.lang.String host,
                                                                                            int port)
        Deprecated.
        Use the new Builder instead.
        Calls getMCServerInfo(String, int) and wraps it into a CompletableFuture<GeneratedImage> for you to use.

        The returned GenericAPIResponse can be one of two instances:

        to see if the request was successful or not can you do this simple check:
        
         GenericAPIResponse response = getMCServerInfo("mc.example.com");
        
         if(response instanceof FailedAPIResponse){
             // The request was not successful!
             System.out.println("Request failed!");
             return;
         }
        
         // Request was successful. Response is a MCServerPingResponse instance!
         GeneratedImage image = (MCServerPingResponse)response;
         
        Parameters:
        host - The server to ping. This can be a domain or IP.
        port - The port to ping the server on.
        Returns:
        GenericAPIResponse that is either a MCServerPingResponse or FailedAPIResponse instance.
        See Also:
        getMCServerInfo