public final class ShareLeaseClientBuilder extends Object
ShareLeaseClient and ShareLeaseAsyncClient are constructed every time
buildClient and buildAsyncClient are called
respectively.
When a client is instantiated and a leaseId hasn't been set a UUID will be used
as the lease identifier.
Instantiating LeaseClients
ShareLeaseClient fileLeaseClient = new ShareLeaseClientBuilder()
.fileClient(shareFileClient)
.leaseId(leaseId)
.buildClient();
ShareLeaseClient fileLeaseClient = new ShareLeaseClientBuilder()
.shareClient(shareClient)
.leaseId(leaseId)
.buildClient();
Instantiating LeaseAsyncClients
ShareLeaseAsyncClient fileLeaseAsyncClient = new ShareLeaseClientBuilder()
.fileAsyncClient(shareFileAsyncClient)
.leaseId(leaseId)
.buildAsyncClient();
ShareLeaseAsyncClient fileLeaseAsyncClient = new ShareLeaseClientBuilder()
.shareAsyncClient(shareAsyncClient)
.leaseId(leaseId)
.buildAsyncClient();
ShareLeaseClient,
ShareLeaseAsyncClient| Constructor and Description |
|---|
ShareLeaseClientBuilder() |
| Modifier and Type | Method and Description |
|---|---|
ShareLeaseAsyncClient |
buildAsyncClient()
Creates a
ShareLeaseAsyncClient based on the configurations set in the builder. |
ShareLeaseClient |
buildClient()
Creates a
ShareLeaseClient based on the configurations set in the builder. |
ShareLeaseClientBuilder |
fileAsyncClient(ShareFileAsyncClient fileAsyncClient)
Configures the builder based on the passed
ShareFileAsyncClient. |
ShareLeaseClientBuilder |
fileClient(ShareFileClient fileClient)
Configures the builder based on the passed
ShareFileClient. |
ShareLeaseClientBuilder |
leaseId(String leaseId)
Sets the identifier for the lease.
|
ShareLeaseClientBuilder |
shareAsyncClient(ShareAsyncClient shareAsyncClient)
Configures the builder based on the passed
ShareAsyncClient. |
ShareLeaseClientBuilder |
shareClient(ShareClient shareClient)
Configures the builder based on the passed
ShareClient. |
public ShareLeaseClient buildClient()
ShareLeaseClient based on the configurations set in the builder.ShareLeaseClient based on the configurations in this builder.public ShareLeaseAsyncClient buildAsyncClient()
ShareLeaseAsyncClient based on the configurations set in the builder.ShareLeaseAsyncClient based on the configurations in this builder.public ShareLeaseClientBuilder fileClient(ShareFileClient fileClient)
ShareFileClient. This will set the HttpPipeline and
URL that are used to interact with the service.fileClient - ShareFileClient used to configure the builder.NullPointerException - If fileClient is null.public ShareLeaseClientBuilder fileAsyncClient(ShareFileAsyncClient fileAsyncClient)
ShareFileAsyncClient. This will set the HttpPipeline
and URL that are used to interact with the service.fileAsyncClient - ShareFileAsyncClient used to configure the builder.NullPointerException - If fileAsyncClient is null.public ShareLeaseClientBuilder shareClient(ShareClient shareClient)
ShareClient. This will set the HttpPipeline and
URL that are used to interact with the service.shareClient - ShareClient used to configure the builder.NullPointerException - If fileClient is null.public ShareLeaseClientBuilder shareAsyncClient(ShareAsyncClient shareAsyncClient)
ShareAsyncClient. This will set the HttpPipeline
and URL that are used to interact with the service.shareAsyncClient - ShareAsyncClient used to configure the builder.NullPointerException - If fileAsyncClient is null.public ShareLeaseClientBuilder leaseId(String leaseId)
If a lease ID isn't set then a UUID will be used.
leaseId - Identifier for the lease.Visit the Azure for Java Developers site for more Java documentation, including quick starts, tutorials, and code samples.