All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nl.tweeenveertig.openstack.headers.object.conditional.IfMatch Maven / Gradle / Ivy

There is a newer version: 0.7.0
Show newest version
package nl.tweeenveertig.openstack.headers.object.conditional;

import nl.tweeenveertig.openstack.exception.HttpStatusExceptionUtil;
import org.apache.http.HttpStatus;

public class IfMatch extends AbstractIfMatch {

    public static final String IF_MATCH = "If-Match";

    public IfMatch(String value) {
        super(value);
    }

    @Override
    public void matchAgainst(String matchValue) {
        if (!getHeaderValue().equals(matchValue)) {
            HttpStatusExceptionUtil.throwException(HttpStatus.SC_PRECONDITION_FAILED);
        }
    }

    @Override
    public String getHeaderName() {
        return IF_MATCH;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy