Class RemoteAPI.Builder

  • Enclosing class:
    RemoteAPI

    public static class RemoteAPI.Builder
    extends Object
    Builder used to create a new immutable RemoteAPI implementation


    This builder provides a fluent API for setting certain object properties and creating a new immutable RemoteAPI instance based on these properties. New builders may be initialized with some existing API instance or even a Proxy, which presets the builders properties to the values of the given object, still retaining the option to make additional changes before actually building a new immutable instance.

    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • from

        public final RemoteAPI.Builder from​(RemoteAPI instance)
        Fill a builder with attribute values from the provided com.github.m0nk3y2k4.thetvdb.internal.connection.RemoteAPI instance.
        Parameters:
        instance - The instance from which to copy values
        Returns:
        this builder for use in a chained invocation
      • from

        public final RemoteAPI.Builder from​(Proxy instance)
        Fill a builder with attribute values from the provided com.github.m0nk3y2k4.thetvdb.api.Proxy instance.
        Parameters:
        instance - The instance from which to copy values
        Returns:
        this builder for use in a chained invocation
      • path

        public final RemoteAPI.Builder path​(String path)
        Initializes the optional value path to path.
        Parameters:
        path - The value for path
        Returns:
        this builder for chained invocation
      • path

        public final RemoteAPI.Builder path​(Optional<String> path)
        Initializes the optional value path to path.
        Parameters:
        path - The value for path
        Returns:
        this builder for use in a chained invocation
      • protocol

        public final RemoteAPI.Builder protocol​(String protocol)
        Initializes the value for the protocol attribute.

        If not set, this attribute will have a default value as returned by the initializer of protocol.

        Parameters:
        protocol - The value for protocol
        Returns:
        this builder for use in a chained invocation
      • host

        public final RemoteAPI.Builder host​(String host)
        Initializes the value for the host attribute.

        If not set, this attribute will have a default value as returned by the initializer of host.

        Parameters:
        host - The value for host
        Returns:
        this builder for use in a chained invocation
      • port

        public final RemoteAPI.Builder port​(int port)
        Initializes the value for the port attribute.

        If not set, this attribute will have a default value as returned by the initializer of port.

        Parameters:
        port - The value for port
        Returns:
        this builder for use in a chained invocation