com.athaydes.rawhttp.reqinedit.ReqInEditEntry Maven / Gradle / Ivy
package com.athaydes.rawhttp.reqinedit;
import javax.annotation.Nullable;
import java.util.List;
import java.util.Optional;
/**
* A single HTTP request in a HTTP file.
*
* It may also contain a response handler script and a response reference (where the HTTP response resulting from
* running the HTTP request will be written).
*/
public final class ReqInEditEntry {
private final String request;
private final List requestBody;
@Nullable
private final StringOrFile script;
@Nullable
private final String responseRef;
public ReqInEditEntry(String request,
List requestBody,
@Nullable StringOrFile script,
@Nullable String responseRef) {
this.request = request;
this.requestBody = requestBody;
this.script = script;
this.responseRef = responseRef;
}
public String getRequest() {
return request;
}
public List getRequestBody() {
return requestBody;
}
public Optional getScript() {
return Optional.ofNullable(script);
}
public Optional getResponseRef() {
return Optional.ofNullable(responseRef);
}
@Override
public String toString() {
return "ReqInEditEntry{" +
"request='" + request + '\'' +
", requestBody=" + requestBody +
", script=" + script +
", responseRef='" + responseRef + '\'' +
'}';
}
}