Class RestApi.Builder<B extends RestApi.Builder<B,​T>,​T extends RestApi>

    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • config

        public B config​(Config config)
        Configure this builder from config. Uses webclient key to configure the WebClient builder, and jsonp key to configure the JSON factories.
        Parameters:
        config - configuration on the node of this rest API
        Returns:
        updated builder
      • faultTolerance

        public B faultTolerance​(FtHandler ftHandler)
        Configure the fault tolerance handler to use with client requests.
        Parameters:
        ftHandler - fault tolerance handler
        Returns:
        updated builder
      • me

        protected B me()
        Allows returning the correct type when subclassing.
        Returns:
        this instance typed as subclass
      • preBuild

        protected void preBuild()
        Pre build method. This implementation builds the web client and sets up JSON factories.
      • postBuild

        protected void postBuild()
        Post build method. This implementation does nothing
      • doBuild

        protected abstract T doBuild()
        Build an instance of RestApi implementation.
        Returns:
        a new instance
      • webClient

        protected WebClient webClient()
        WebClient instance, available after postBuild() is called.
        Returns:
        web client
      • ftHandler

        protected FtHandler ftHandler()
        Configured Fault tolerance handler.
        Returns:
        handler
      • jsonBuilderFactory

        protected JsonBuilderFactory jsonBuilderFactory()
        JSON builder factory.
        Returns:
        builder factory
      • jsonReaderFactory

        protected JsonReaderFactory jsonReaderFactory()
        JSON reader factory.
        Returns:
        reader factory
      • jsonWriterFactory

        protected JsonWriterFactory jsonWriterFactory()
        JSON writer factory.
        Returns:
        writer factory