Package com.azure.core.http
Class RequestConditions
java.lang.Object
com.azure.core.http.MatchConditions
com.azure.core.http.RequestConditions
Specifies HTTP options for conditional requests based on modification time and ETag matching.
This class extends MatchConditions and adds conditions based on the modification time of the resource.
It encapsulates conditions such as If-Modified-Since and If-Unmodified-Since, in addition to If-Match and
If-None-Match from MatchConditions.
This class is useful when you want to create an HTTP request with conditional headers based on the modification time of the resource and ETag matching. For example, you can use it to create a GET request that only retrieves the resource if it has been modified since a specific time, or a PUT request that only updates the resource if it has not been modified by another client since a specific time.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets thedatetimethat resources must have been modified since.Gets thedatetimethat resources must have remained unmodified since.setIfMatch(String ifMatch) Optionally limit requests to resources that match the passed ETag.setIfModifiedSince(OffsetDateTime ifModifiedSince) Optionally limit requests to resources that have only been modified since the passeddatetime.setIfNoneMatch(String ifNoneMatch) Optionally limit requests to resources that do not match the passed ETag.setIfUnmodifiedSince(OffsetDateTime ifUnmodifiedSince) Optionally limit requests to resources that have remained unmodified since the passeddatetime.Methods inherited from class com.azure.core.http.MatchConditions
getIfMatch, getIfNoneMatch
-
Constructor Details
-
RequestConditions
public RequestConditions()Creates a new instance ofRequestConditions.
-
-
Method Details
-
setIfMatch
Optionally limit requests to resources that match the passed ETag.- Overrides:
setIfMatchin classMatchConditions- Parameters:
ifMatch- ETag that resources must match.- Returns:
- The updated ResourceConditions object.
-
setIfNoneMatch
Optionally limit requests to resources that do not match the passed ETag.- Overrides:
setIfNoneMatchin classMatchConditions- Parameters:
ifNoneMatch- ETag that resources must not match.- Returns:
- The updated ResourceConditions object.
-
getIfModifiedSince
Gets thedatetimethat resources must have been modified since.- Returns:
- The datetime that resources must have been modified since.
-
setIfModifiedSince
Optionally limit requests to resources that have only been modified since the passeddatetime.- Parameters:
ifModifiedSince- The datetime that resources must have been modified since.- Returns:
- The updated ResourceConditions object.
-
getIfUnmodifiedSince
Gets thedatetimethat resources must have remained unmodified since.- Returns:
- The datetime that resources must have remained unmodified since.
-
setIfUnmodifiedSince
Optionally limit requests to resources that have remained unmodified since the passeddatetime.- Parameters:
ifUnmodifiedSince- The datetime that resources must have remained unmodified since.- Returns:
- The updated ResourceConditions object.
-