Class ApiContext


  • @Immutable
    public abstract class ApiContext
    extends java.lang.Object
    API context is a model with core functionality to work with Yandex.Translate API.
    • Constructor Detail

      • ApiContext

        public ApiContext()
    • Method Detail

      • key

        @Nonnull
        public abstract java.lang.String key()
        Get Yandex.Translate API key.
        Returns:
        API key
      • client

        @Nonnull
        public abstract RestClient client()
        Get REST client. It allows to fetch data from Yandex.Translate service.
        Returns:
        REST client
      • converter

        @Nonnull
        public abstract DataConverter converter()
        Get data converter. It is necessary to convert data from REST client to internal models.
        Returns:
        data converter
      • of

        @Nonnull
        public static ApiContext of​(java.lang.String key)
        Create API context object with default configuration.
        Parameters:
        key - Yandex.Translate API key
        Returns:
        API context