RequestConditions Class
- java.
lang. Object - com.
azure. core. http. MatchConditions - com.
azure. core. http. RequestConditions
- com.
- com.
public class RequestConditions
extends MatchConditions
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.
Constructor Summary
Constructor | Description |
---|---|
RequestConditions() |
Creates a new instance of RequestConditions. |
Method Summary
Modifier and Type | Method and Description |
---|---|
Offset |
getIfModifiedSince()
Gets the datetime that resources must have been modified since. |
Offset |
getIfUnmodifiedSince()
Gets the datetime that resources must have remained unmodified since. |
Request |
setIfMatch(String ifMatch)
Optionally limit requests to resources that match the passed ETag. |
Request |
setIfModifiedSince(OffsetDateTime ifModifiedSince)
Optionally limit requests to resources that have only been modified since the passed datetime. |
Request |
setIfNoneMatch(String ifNoneMatch)
Optionally limit requests to resources that do not match the passed ETag. |
Request |
setIfUnmodifiedSince(OffsetDateTime ifUnmodifiedSince)
Optionally limit requests to resources that have remained unmodified since the passed datetime. |
Methods inherited from MatchConditions
Methods inherited from java.lang.Object
Constructor Details
RequestConditions
public RequestConditions()
Creates a new instance of RequestConditions.
Method Details
getIfModifiedSince
public OffsetDateTime getIfModifiedSince()
Gets the datetime that resources must have been modified since.
Returns:
getIfUnmodifiedSince
public OffsetDateTime getIfUnmodifiedSince()
Gets the datetime that resources must have remained unmodified since.
Returns:
setIfMatch
public RequestConditions setIfMatch(String ifMatch)
Optionally limit requests to resources that match the passed ETag.
Overrides:
RequestConditions.setIfMatch(String ifMatch)Parameters:
Returns:
setIfModifiedSince
public RequestConditions setIfModifiedSince(OffsetDateTime ifModifiedSince)
Optionally limit requests to resources that have only been modified since the passed datetime.
Parameters:
Returns:
setIfNoneMatch
public RequestConditions setIfNoneMatch(String ifNoneMatch)
Optionally limit requests to resources that do not match the passed ETag.
Overrides:
RequestConditions.setIfNoneMatch(String ifNoneMatch)Parameters:
Returns:
setIfUnmodifiedSince
public RequestConditions setIfUnmodifiedSince(OffsetDateTime ifUnmodifiedSince)
Optionally limit requests to resources that have remained unmodified since the passed datetime.
Parameters:
Returns:
Applies to
Azure SDK for Java