Class BlobLeaseClientBuilder
- java.lang.Object
-
- com.azure.storage.blob.specialized.BlobLeaseClientBuilder
-
public final class BlobLeaseClientBuilder extends Object
This class provides a fluent builder API to help aid the configuration and instantiation of Storage Lease clients. Lease clients are able to interact with both container and blob clients and act as a supplement client. A new instance ofBlobLeaseClientandBlobLeaseAsyncClientare constructed every timebuildClientandbuildAsyncClientare called respectively.When a client is instantiated and a
leaseIdhasn't been set aUUIDwill be used as the lease identifier.Instantiating LeaseClients
BlobLeaseClient blobLeaseClient = new BlobLeaseClientBuilder() .blobClient(blobClient) .leaseId(leaseId) .buildClient();BlobLeaseClient blobLeaseClient = new BlobLeaseClientBuilder() .containerClient(blobContainerClient) .leaseId(leaseId) .buildClient();Instantiating LeaseAsyncClients
BlobLeaseAsyncClient blobLeaseAsyncClient = new BlobLeaseClientBuilder() .blobAsyncClient(blobAsyncClient) .leaseId(leaseId) .buildAsyncClient();BlobLeaseAsyncClient blobLeaseAsyncClient = new BlobLeaseClientBuilder() .containerAsyncClient(blobContainerAsyncClient) .leaseId(leaseId) .buildAsyncClient();- See Also:
BlobLeaseClient,BlobLeaseAsyncClient
-
-
Constructor Summary
Constructors Constructor Description BlobLeaseClientBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BlobLeaseClientBuilderblobAsyncClient(BlobAsyncClientBase blobAsyncClient)Configures the builder based on the passedBlobAsyncClient.BlobLeaseClientBuilderblobClient(BlobClientBase blobClient)Configures the builder based on the passedBlobClient.BlobLeaseAsyncClientbuildAsyncClient()Creates aBlobLeaseAsyncClientbased on the configurations set in the builder.BlobLeaseClientbuildClient()Creates aBlobLeaseClientbased on the configurations set in the builder.BlobLeaseClientBuildercontainerAsyncClient(BlobContainerAsyncClient blobContainerAsyncClient)Configures the builder based on the passedBlobContainerAsyncClient.BlobLeaseClientBuildercontainerClient(BlobContainerClient blobContainerClient)Configures the builder based on the passedBlobContainerClient.BlobLeaseClientBuilderleaseId(String leaseId)Sets the identifier for the lease.
-
-
-
Method Detail
-
buildClient
public BlobLeaseClient buildClient()
Creates aBlobLeaseClientbased on the configurations set in the builder.- Returns:
- a
BlobLeaseClientbased on the configurations in this builder.
-
buildAsyncClient
public BlobLeaseAsyncClient buildAsyncClient()
Creates aBlobLeaseAsyncClientbased on the configurations set in the builder.- Returns:
- a
BlobLeaseAsyncClientbased on the configurations in this builder.
-
blobClient
public BlobLeaseClientBuilder blobClient(BlobClientBase blobClient)
Configures the builder based on the passedBlobClient. This will set theHttpPipelineandURLthat are used to interact with the service.- Parameters:
blobClient- BlobClient used to configure the builder.- Returns:
- the updated BlobLeaseClientBuilder object
- Throws:
NullPointerException- IfblobClientisnull.
-
blobAsyncClient
public BlobLeaseClientBuilder blobAsyncClient(BlobAsyncClientBase blobAsyncClient)
Configures the builder based on the passedBlobAsyncClient. This will set theHttpPipelineandURLthat are used to interact with the service.- Parameters:
blobAsyncClient- BlobAsyncClient used to configure the builder.- Returns:
- the updated BlobLeaseClientBuilder object
- Throws:
NullPointerException- IfblobAsyncClientisnull.
-
containerClient
public BlobLeaseClientBuilder containerClient(BlobContainerClient blobContainerClient)
Configures the builder based on the passedBlobContainerClient. This will set theHttpPipelineandURLthat are used to interact with the service.- Parameters:
blobContainerClient- ContainerClient used to configure the builder.- Returns:
- the updated BlobLeaseClientBuilder object
- Throws:
NullPointerException- IfcontainerClientisnull.
-
containerAsyncClient
public BlobLeaseClientBuilder containerAsyncClient(BlobContainerAsyncClient blobContainerAsyncClient)
Configures the builder based on the passedBlobContainerAsyncClient. This will set theHttpPipelineandURLthat are used to interact with the service.- Parameters:
blobContainerAsyncClient- ContainerAsyncClient used to configure the builder.- Returns:
- the updated BlobLeaseClientBuilder object
- Throws:
NullPointerException- IfcontainerAsyncClientisnull.
-
leaseId
public BlobLeaseClientBuilder leaseId(String leaseId)
Sets the identifier for the lease.If a lease ID isn't set then a
UUIDwill be used.- Parameters:
leaseId- Identifier for the lease.- Returns:
- the updated BlobLeaseClientBuilder object
-
-