Package com.longport
Class ConfigBuilder
- java.lang.Object
-
- com.longport.ConfigBuilder
-
public class ConfigBuilder extends Object
A Config object builder
-
-
Constructor Summary
Constructors Constructor Description ConfigBuilder(String appKey, String appSecret, String accessToken)
Create a `Config` object builder
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Config
build()
Build a Config objectConfigBuilder
dontPrintQuotePackages()
Don't print quote packages when connected to the serverConfigBuilder
enableOvernight()
Enable overnight quoteConfigBuilder
httpUrl(String httpUrl)
Specifies the url of the OpenAPI server.ConfigBuilder
language(Language language)
Specifies the language identiferConfigBuilder
pushCandlestickMode(PushCandlestickMode mode)
Specifies the push candlestick modeConfigBuilder
quoteWebsocketUrl(String quoteWsUrl)
Specifies the url of the OpenAPI quote websocket server.ConfigBuilder
tradeWebsocketUrl(String tradeWsUrl)
Specifies the url of the OpenAPI trade websocket server.
-
-
-
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
-
dontPrintQuotePackages
public ConfigBuilder dontPrintQuotePackages()
Don't print quote packages when connected to the server- Returns:
- this object
-
build
public Config build() throws OpenApiException
Build a Config object- Returns:
- Config object
- Throws:
OpenApiException
- If an error occurs
-
-