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

org.mockserver.model.StringBody Maven / Gradle / Ivy

There is a newer version: 5.15.0
Show newest version
package org.mockserver.model;

/**
 * @author jamesdbloom
 */
public class StringBody extends Body {

    private final String value;

    public StringBody(String value, Type type) {
        super(type);
        this.value = value;
    }

    public static StringBody exact(String body) {
        return new StringBody(body, Type.EXACT);
    }

    public static StringBody regex(String body) {
        return new StringBody(body, Type.REGEX);
    }

    public static StringBody xpath(String body) {
        return new StringBody(body, Type.XPATH);
    }

    public static StringBody json(String body) {
        return new StringBody(body, Type.JSON);
    }

    public String getValue() {
        return value;
    }

    @Override
    public String toString() {
        return value;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy