public final class BlobLeaseClientBuilder extends Object
BlobLeaseClient and BlobLeaseAsyncClient 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
BlobLeaseClientblobLeaseClient = newBlobLeaseClientBuilder() .blobClient(blobClient) .leaseId(leaseId) .buildClient();
BlobLeaseClientblobLeaseClient = newBlobLeaseClientBuilder() .containerClient(blobContainerClient) .leaseId(leaseId) .buildClient();
Instantiating LeaseAsyncClients
BlobLeaseAsyncClientblobLeaseAsyncClient = newBlobLeaseClientBuilder() .blobAsyncClient(blobAsyncClient) .leaseId(leaseId) .buildAsyncClient();
BlobLeaseAsyncClientblobLeaseAsyncClient = newBlobLeaseClientBuilder() .containerAsyncClient(blobContainerAsyncClient) .leaseId(leaseId) .buildAsyncClient();
BlobLeaseClient,
BlobLeaseAsyncClient| Constructor and Description |
|---|
BlobLeaseClientBuilder() |
| Modifier and Type | Method and Description |
|---|---|
BlobLeaseClientBuilder |
blobAsyncClient(BlobAsyncClientBase blobAsyncClient)
Configures the builder based on the passed
BlobAsyncClient. |
BlobLeaseClientBuilder |
blobClient(BlobClientBase blobClient)
Configures the builder based on the passed
BlobClient. |
BlobLeaseAsyncClient |
buildAsyncClient()
Creates a
BlobLeaseAsyncClient based on the configurations set in the builder. |
BlobLeaseClient |
buildClient()
Creates a
BlobLeaseClient based on the configurations set in the builder. |
BlobLeaseClientBuilder |
containerAsyncClient(BlobContainerAsyncClient blobContainerAsyncClient)
Configures the builder based on the passed
BlobContainerAsyncClient. |
BlobLeaseClientBuilder |
containerClient(BlobContainerClient blobContainerClient)
Configures the builder based on the passed
BlobContainerClient. |
BlobLeaseClientBuilder |
leaseId(String leaseId)
Sets the identifier for the lease.
|
public BlobLeaseClient buildClient()
BlobLeaseClient based on the configurations set in the builder.BlobLeaseClient based on the configurations in this builder.public BlobLeaseAsyncClient buildAsyncClient()
BlobLeaseAsyncClient based on the configurations set in the builder.BlobLeaseAsyncClient based on the configurations in this builder.public BlobLeaseClientBuilder blobClient(BlobClientBase blobClient)
BlobClient. This will set the HttpPipeline and
URL that are used to interact with the service.blobClient - BlobClient used to configure the builder.NullPointerException - If blobClient is null.public BlobLeaseClientBuilder blobAsyncClient(BlobAsyncClientBase blobAsyncClient)
BlobAsyncClient. This will set the HttpPipeline and
URL that are used to interact with the service.blobAsyncClient - BlobAsyncClient used to configure the builder.NullPointerException - If blobAsyncClient is null.public BlobLeaseClientBuilder containerClient(BlobContainerClient blobContainerClient)
BlobContainerClient. This will set the HttpPipeline
and URL that are used to interact with the service.blobContainerClient - ContainerClient used to configure the builder.NullPointerException - If containerClient is null.public BlobLeaseClientBuilder containerAsyncClient(BlobContainerAsyncClient blobContainerAsyncClient)
BlobContainerAsyncClient. This will set the HttpPipeline and URL that are used to interact with the service.blobContainerAsyncClient - ContainerAsyncClient used to configure the builder.NullPointerException - If containerAsyncClient is null.public BlobLeaseClientBuilder leaseId(String leaseId)
If a lease ID isn't set then a UUID will be used.
leaseId - Identifier for the lease.Copyright © 2020 Microsoft Corporation. All rights reserved.