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 = newShareLeaseClientBuilder
() .fileClient(shareFileClient) .leaseId(leaseId) .buildClient();
Instantiating LeaseAsyncClients
ShareLeaseAsyncClient
fileLeaseAsyncClient = newShareLeaseClientBuilder
() .fileAsyncClient(shareFileAsyncClient) .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.
|
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
- BlobAsyncClient 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.Copyright © 2020 Microsoft Corporation. All rights reserved.