Class TableClientBuilder

java.lang.Object
com.azure.data.tables.TableClientBuilder
All Implemented Interfaces:
AzureNamedKeyCredentialTrait<TableClientBuilder>, AzureSasCredentialTrait<TableClientBuilder>, ConfigurationTrait<TableClientBuilder>, ConnectionStringTrait<TableClientBuilder>, EndpointTrait<TableClientBuilder>, HttpTrait<TableClientBuilder>, TokenCredentialTrait<TableClientBuilder>

This class provides a fluent builder API to help aid the configuration and instantiation of TableClient and TableAsyncClient objects. Call buildClient() or buildAsyncClient(), respectively, to construct an instance of the desired client.

The minimal configuration options required by TableClientBuilder to build a TableClient or TableAsyncClient are a tableName and endpoint and a form of authentication, which can be set via: connectionString(String), credential(AzureSasCredential), credential(AzureNamedKeyCredential) or sasToken(String)

Samples to construct a sync client

 TableClient tableClient = new TableClientBuilder()
     .endpoint("https://myaccount.core.windows.net/")
     .credential(new AzureNamedKeyCredential("name", "key"))
     .tableName("myTable")
     .buildClient();
 

Samples to construct an async client

 TableAsyncClient tableAsyncClient = new TableClientBuilder()
     .endpoint("https://myaccount.core.windows.net/")
     .credential(new AzureNamedKeyCredential("name", "key"))
     .tableName("myTable")
     .buildAsyncClient();
 
See Also: