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 ofShareLeaseClientandShareLeaseAsyncClientare 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
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:
ShareLeaseClient,ShareLeaseAsyncClient
-
-
Constructor Summary
Constructors Constructor Description ShareLeaseClientBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ShareLeaseAsyncClientbuildAsyncClient()Creates aShareLeaseAsyncClientbased on the configurations set in the builder.ShareLeaseClientbuildClient()Creates aShareLeaseClientbased on the configurations set in the builder.ShareLeaseClientBuilderfileAsyncClient(ShareFileAsyncClient fileAsyncClient)Configures the builder based on the passedShareFileAsyncClient.ShareLeaseClientBuilderfileClient(ShareFileClient fileClient)Configures the builder based on the passedShareFileClient.ShareLeaseClientBuilderleaseId(String leaseId)Sets the identifier for the lease.ShareLeaseClientBuildershareAsyncClient(ShareAsyncClient shareAsyncClient)Configures the builder based on the passedShareAsyncClient.ShareLeaseClientBuildershareClient(ShareClient shareClient)Configures the builder based on the passedShareClient.
-
-
-
Method Detail
-
buildClient
public ShareLeaseClient buildClient()
Creates aShareLeaseClientbased on the configurations set in the builder.- Returns:
- a
ShareLeaseClientbased on the configurations in this builder.
-
buildAsyncClient
public ShareLeaseAsyncClient buildAsyncClient()
Creates aShareLeaseAsyncClientbased on the configurations set in the builder.- Returns:
- a
ShareLeaseAsyncClientbased on the configurations in this builder.
-
fileClient
public ShareLeaseClientBuilder fileClient(ShareFileClient fileClient)
Configures the builder based on the passedShareFileClient. This will set theHttpPipelineandURLthat are used to interact with the service.- Parameters:
fileClient- ShareFileClient used to configure the builder.- Returns:
- the updated ShareLeaseClientBuilder object
- Throws:
NullPointerException- IffileClientisnull.
-
fileAsyncClient
public ShareLeaseClientBuilder fileAsyncClient(ShareFileAsyncClient fileAsyncClient)
Configures the builder based on the passedShareFileAsyncClient. This will set theHttpPipelineandURLthat are used to interact with the service.- Parameters:
fileAsyncClient- ShareFileAsyncClient used to configure the builder.- Returns:
- the updated ShareLeaseClientBuilder object
- Throws:
NullPointerException- IffileAsyncClientisnull.
-
shareClient
public ShareLeaseClientBuilder shareClient(ShareClient shareClient)
Configures the builder based on the passedShareClient. This will set theHttpPipelineandURLthat are used to interact with the service.- Parameters:
shareClient- ShareClient used to configure the builder.- Returns:
- the updated ShareLeaseClientBuilder object
- Throws:
NullPointerException- IffileClientisnull.
-
shareAsyncClient
public ShareLeaseClientBuilder shareAsyncClient(ShareAsyncClient shareAsyncClient)
Configures the builder based on the passedShareAsyncClient. This will set theHttpPipelineandURLthat are used to interact with the service.- Parameters:
shareAsyncClient- ShareAsyncClient used to configure the builder.- Returns:
- the updated ShareLeaseClientBuilder object
- Throws:
NullPointerException- IffileAsyncClientisnull.
-
leaseId
public ShareLeaseClientBuilder 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 ShareLeaseClientBuilder object
-
-