Class ShareLeaseClientBuilder

java.lang.Object
com.azure.storage.file.share.specialized.ShareLeaseClientBuilder

public final class ShareLeaseClientBuilder 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 share and share file clients and act as a supplement client. A new instance of 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();
 
See Also: