Class Config.Builder<T extends Config.Builder<T>>

  • Enclosing class:
    Config

    public abstract static class Config.Builder<T extends Config.Builder<T>>
    extends Object
    The builder of a configuration object.
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • getThis

        protected abstract T getThis()
        Standard design pattern. See http://www.angelikalanger.com/GenericsFAQ/FAQSections/ProgrammingIdioms.html#FAQ205
      • setMaxGasPerViewTransaction

        public T setMaxGasPerViewTransaction​(BigInteger maxGasPerViewTransaction)
        Sets the maximal amount of gas that a view transaction can consume. It defaults to 100_000_000.
      • setDir

        public T setDir​(Path dir)
        Sets the directory where the node's data will be persisted. It defaults to chain in the current directory.
        Parameters:
        dir - the directory
        Returns:
        this builder
      • setMaxPollingAttempts

        public T setMaxPollingAttempts​(int maxPollingAttempts)
        Sets the maximal number of polling attempts, in milliseconds, while waiting for the result of a posted transaction. It defaults to 60.
        Parameters:
        maxPollingAttempts - the the maximal number of polling attempts
        Returns:
        this builder
      • setPollingDelay

        public T setPollingDelay​(int pollingDelay)
        Sets the delay of two subsequent polling attempts, in milliseconds, while waiting for the result of a posted transaction. This delay is then increased by 10% at each subsequent attempt. It defaults to 10.
        Parameters:
        pollingDelay - the delay
        Returns:
        this builder
      • setRequestCacheSize

        public T setRequestCacheSize​(int requestCacheSize)
        Sets size of the cache for the Node.getRequest(TransactionReference) method. It defaults to 1,000.
        Parameters:
        requestCacheSize - the cache size
        Returns:
        this builder
      • setResponseCacheSize

        public T setResponseCacheSize​(int responseCacheSize)
        Sets size of the cache for the Node.getResponse(TransactionReference) method. It defaults to 1,000.
        Parameters:
        responseCacheSize - the cache size
        Returns:
        this builder
      • build

        public Config build()
        Builds the configuration.
        Returns:
        the configuration