Interface EntityConnection.Builder<T extends EntityConnection,B extends EntityConnection.Builder<T,B>>

Type Parameters:
T - the connection type
B - the builder type
All Known Subinterfaces:
HttpEntityConnection.Builder, LocalEntityConnection.Builder, RemoteEntityConnection.Builder
All Known Implementing Classes:
AbstractEntityConnection.AbstractBuilder, DefaultHttpEntityConnectionBuilder, DefaultLocalEntityConnectionBuilder, DefaultRemoteEntityConnectionBuilder
Enclosing interface:
EntityConnection

public static interface EntityConnection.Builder<T extends EntityConnection,B extends EntityConnection.Builder<T,B>>
Builds a self-managing EntityConnection.
See Also:
  • Method Details

    • supports

      boolean supports(String connectionType)
      Parameters:
      connectionType - the connection type
      Returns:
      true if this builder supports the given connection type, e.g. "local", "remote" or "http"
    • user

      B user(User user)
      Parameters:
      user - the user
      Returns:
      this builder instance
    • domain

      B domain(DomainType domainType)

      Sets the domain by type, leaving a connection needing the domain in-process to resolve an instance via ServiceLoader.

      Discards an instance previously set via domain(Domain) unless it is of this type.

      Parameters:
      domainType - the domain type to base this connection on
      Returns:
      this builder instance
      See Also:
    • domain

      B domain(Domain domain)

      Sets the domain by instance, and thereby its type. Connections which run the domain in-process (a local connection for example) use the given instance directly, instead of resolving one via ServiceLoader from its Domain.type().

      Supplying an instance keeps the ServiceLoader out of the picture entirely.

      Parameters:
      domain - the domain instance to base this connection on
      Returns:
      this builder instance
      See Also:
    • clientId

      B clientId(UUID clientId)
      Parameters:
      clientId - the UUID identifying this client connection
      Returns:
      this builder instance
    • clientType

      B clientType(String clientType)
      If no client type is specified, DomainType.name() is used.
      Parameters:
      clientType - a String identifying the client type for this connection
      Returns:
      this builder instance
      See Also:
    • clientVersion

      B clientVersion(@Nullable Version clientVersion)
      Parameters:
      clientVersion - the client version
      Returns:
      this builder instance
    • build

      T build()
      Returns:
      a new EntityConnection instance