public abstract class ApiBuilder<T extends ApiBuilder<T,E>,E extends IotaAPICore> extends AbstractBuilder<T,E,ApiConfig> implements ApiSettings
| Constructor and Description |
|---|
ApiBuilder() |
| Modifier and Type | Method and Description |
|---|---|
T |
addNode(Connection c) |
protected T |
generate()
Generates values for options which were not assigned through the builder.
|
int |
getConnectionTimeout()
Connection time out in seconds
|
ICurl |
getCustomCurl() |
String |
getHost() |
String |
getLegacyHost() |
int |
getLegacyPort() |
String |
getLegacyProtocol() |
IotaPoW |
getLocalPoW() |
List<Connection> |
getNodes() |
int |
getPort() |
String |
getProtocol() |
boolean |
hasNodes() |
T |
host(String host)
Sets the legacy host field after checking if the address is valid (network check)
|
T |
host(String host,
boolean check)
Sets the legacy host field
|
T |
localPoW(IotaPoW localPoW) |
T |
port(int port) |
T |
protocol(String protocol) |
T |
timeout(int timeout) |
T |
withCustomCurl(ICurl curl) |
build, compile, config, config, config, getConfig, getConfigsprotected T generate() throws Exception
AbstractBuilder.config(org.iota.jota.config.Config)
THen checks Environment, and in the end goes to IotaDefaultConfig for defaultsgenerate in class AbstractBuilder<T extends ApiBuilder<T,E>,E extends IotaAPICore,ApiConfig>Exception - When we failed to load env configs or a url was malformedpublic T host(String host, boolean check)
host - The host to setcheck - if we should check if the address is valid (network check)public T host(String host)
host - The host to setpublic T port(int port)
public T timeout(int timeout)
public String getProtocol()
public String getHost()
public int getPort()
public IotaPoW getLocalPoW()
getLocalPoW in interface ApiBuilderSettingspublic ICurl getCustomCurl()
getCustomCurl in interface ApiBuilderSettingspublic T addNode(Connection c)
public List<Connection> getNodes()
public int getConnectionTimeout()
ApiConfiggetConnectionTimeout in interface ApiConfigpublic int getLegacyPort()
getLegacyPort in interface ApiConfigpublic String getLegacyProtocol()
getLegacyProtocol in interface ApiConfigpublic String getLegacyHost()
getLegacyHost in interface ApiConfigCopyright © 2019. All rights reserved.