
org.mockserver.model.XPathBody Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mockserver-core Show documentation
Show all versions of mockserver-core Show documentation
Functionality used by all MockServer modules for matching and expectations
package org.mockserver.model;
import java.util.Objects;
/**
* @author jamesdbloom
*/
public class XPathBody extends Body {
private int hashCode;
private final String xpath;
public XPathBody(String xpath) {
super(Type.XPATH);
this.xpath = xpath;
}
public String getValue() {
return xpath;
}
public static XPathBody xpath(String xpath) {
return new XPathBody(xpath);
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
if (hashCode() != o.hashCode()) {
return false;
}
if (!super.equals(o)) {
return false;
}
XPathBody xPathBody = (XPathBody) o;
return Objects.equals(xpath, xPathBody.xpath);
}
@Override
public int hashCode() {
if (hashCode == 0) {
hashCode = Objects.hash(super.hashCode(), xpath);
}
return hashCode;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy