Class LanguagesAPI


  • public final class LanguagesAPI
    extends Resource
    Implementation of a connector for the remote API's Languages endpoint.


    Provides static access to all routes of this endpoint which may be used to retrieve available languages and related information.

    • Method Detail

      • getAllAvailable

        public static com.fasterxml.jackson.databind.JsonNode getAllAvailable​(@Nonnull
                                                                              APIConnection con)
                                                                       throws APIException
        Returns an overview of all supported languages as raw JSON. These language abbreviations can be used to set the preferred language for the communication with the remote service.


        Corresponds to remote API route: [GET] /languages

        Parameters:
        con - Initialized connection to be used for API communication
        Returns:
        JSON object containing all languages that are supported by the remote service
        Throws:
        APIException - If an exception with the remote API occurs, e.g. authentication failure, IO error, resource not found, etc.
      • get

        public static com.fasterxml.jackson.databind.JsonNode get​(@Nonnull
                                                                  APIConnection con,
                                                                  long id)
                                                           throws APIException
        Returns further language information for a given language ID as raw JSON. The language abbreviation can be used to set the preferred language for the communication with the remote service.


        Corresponds to remote API route: [GET] /languages/{id}

        Parameters:
        con - Initialized connection to be used for API communication
        id - The ID of the language
        Returns:
        JSON object containing detailed language information
        Throws:
        APIException - If an exception with the remote API occurs, e.g. authentication failure, IO error, resource not found, etc. or if the given language ID does not exist.