Package com.longport

Class ConfigBuilder


  • public class ConfigBuilder
    extends Object
    A Config object builder
    • Constructor Detail

      • ConfigBuilder

        public ConfigBuilder​(String appKey,
                             String appSecret,
                             String accessToken)
        Create a `Config` object builder
        Parameters:
        appKey - App Key
        appSecret - App Secret
        accessToken - Access Token
    • Method Detail

      • httpUrl

        public ConfigBuilder httpUrl​(String httpUrl)
        Specifies the url of the OpenAPI server.

        NOTE: Usually you don’t need to change it.

        Parameters:
        httpUrl - OpenAPI endpoint (Default: `https://openapi.longportapp.com`)
        Returns:
        this object
      • quoteWebsocketUrl

        public ConfigBuilder quoteWebsocketUrl​(String quoteWsUrl)
        Specifies the url of the OpenAPI quote websocket server.

        NOTE: Usually you don’t need to change it.

        Parameters:
        quoteWsUrl - OpenAPI quote websocket endpoint (Default: `wss://openapi-quote.longportapp.com`)
        Returns:
        this object
      • tradeWebsocketUrl

        public ConfigBuilder tradeWebsocketUrl​(String tradeWsUrl)
        Specifies the url of the OpenAPI trade websocket server.

        NOTE: Usually you don’t need to change it.

        Parameters:
        tradeWsUrl - OpenAPI trade websocket endpoint (Default: `wss://openapi-quote.longportapp.com`)
        Returns:
        this object
      • language

        public ConfigBuilder language​(Language language)
        Specifies the language identifer
        Parameters:
        language - Language identifer (Default: Language.EN)
        Returns:
        this object
      • enableOvernight

        public ConfigBuilder enableOvernight()
        Enable overnight quote
        Returns:
        this object
      • pushCandlestickMode

        public ConfigBuilder pushCandlestickMode​(PushCandlestickMode mode)
        Specifies the push candlestick mode
        Parameters:
        mode - Mode (Default: PushCandlestickMode.Realtime)
        Returns:
        this object