Class MatchConditions

java.lang.Object
com.azure.core.http.MatchConditions
Direct Known Subclasses:
RequestConditions

public class MatchConditions extends Object

Specifies HTTP options for conditional requests based on ETag matching.

This class encapsulates the ETag conditions that can be used in a request, such as If-Match and If-None-Match.

This class is useful when you want to create an HTTP request with conditional headers based on ETag matching. For example, you can use it to create a GET request that only retrieves the resource if it has not been modified (based on the ETag), or a PUT request that only updates the resource if it has not been modified by another client (based on the ETag).

See Also:
  • Constructor Details

    • MatchConditions

      public MatchConditions()
      Creates a new instance of MatchConditions.
  • Method Details

    • getIfMatch

      public String getIfMatch()
      Gets the ETag that resources must match.
      Returns:
      The ETag that resources must match.
    • setIfMatch

      public MatchConditions setIfMatch(String ifMatch)
      Optionally limit requests to resources that match the passed ETag.
      Parameters:
      ifMatch - ETag that resources must match.
      Returns:
      The updated MatchConditions object.
    • getIfNoneMatch

      public String getIfNoneMatch()
      Gets the ETag that resources must not match.
      Returns:
      The ETag that resources must not match.
    • setIfNoneMatch

      public MatchConditions setIfNoneMatch(String ifNoneMatch)
      Optionally limit requests to resources that do not match the passed ETag.
      Parameters:
      ifNoneMatch - ETag that resources must not match.
      Returns:
      The updated MatchConditions object.