public ParameterBody(Parameter... parameters) { this(new Parameters().withEntries(parameters)); }
public boolean hasQueryStringParameter(String name, String value) { return this.queryStringParameters.containsEntry(name, value); }
public Parameters clone() { return new Parameters().withEntries(getEntries()); } }
/** * The query string parameters to match on as a list of Parameter objects where the values or keys of each parameter can be either a string or a regex * (for more details of the supported regex syntax see http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html) * * @param parameters the list of Parameter objects where the values or keys of each parameter can be either a string or a regex */ public HttpRequest withQueryStringParameters(List<Parameter> parameters) { this.queryStringParameters.withEntries(parameters); return this; }
@Override public void serialize(ParameterBody parameterBody, JsonGenerator jgen, SerializerProvider provider) throws IOException { jgen.writeStartObject(); if (parameterBody.getNot() != null && parameterBody.getNot()) { jgen.writeBooleanField("not", parameterBody.getNot()); } jgen.writeStringField("type", parameterBody.getType().name()); if (!parameterBody.getValue().isEmpty()) { jgen.writeObjectField("value", parameterBody.getValue()); } jgen.writeEndObject(); } }
/** * Adds one query string parameter to match on as a Parameter object where the parameter values list can be a list of strings or regular expressions * (for more details of the supported regex syntax see http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html) * * @param parameter the Parameter object which can have a values list of strings or regular expressions */ public HttpRequest withQueryStringParameter(Parameter parameter) { this.queryStringParameters.withEntry(parameter); return this; }
public List<Parameter> getQueryStringParameterList() { return this.queryStringParameters.getEntries(); }
public HttpRequest clone() { return not(request(), not) .withMethod(method) .withPath(path) .withQueryStringParameters(getQueryStringParameters().clone()) .withBody(body) .withHeaders(getHeaders().clone()) .withCookies(getCookies().clone()) .withKeepAlive(keepAlive) .withSecure(secure); }
@Override public Parameters build() { return new Parameters(); } }
public String getFirstQueryStringParameter(String name) { return this.queryStringParameters.getFirstValue(name); }
public HttpRequest update(HttpRequest replaceRequest) { if (!Strings.isNullOrEmpty(replaceRequest.getMethod().getValue())) { withMethod(replaceRequest.getMethod()); } if (!Strings.isNullOrEmpty(replaceRequest.getPath().getValue())) { withPath(replaceRequest.getPath()); } for (Header header : replaceRequest.getHeaderList()) { getHeaders().replaceEntry(header); } for (Cookie cookie : replaceRequest.getCookieList()) { withCookie(cookie); } for (Parameter parameter : replaceRequest.getQueryStringParameterList()) { getQueryStringParameters().replaceEntry(parameter); } if (replaceRequest.getBody() != null) { withBody(replaceRequest.getBody()); } if (replaceRequest.isSecure() != null) { withSecure(replaceRequest.isSecure()); } if (replaceRequest.isKeepAlive() != null) { withKeepAlive(replaceRequest.isKeepAlive()); } return this; } }
/** * The query string parameters to match on as a Map<String, List<String>> where the values or keys of each parameter can be either a string or a regex * (for more details of the supported regex syntax see http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html) * * @param parameters the Map<String, List<String>> object where the values or keys of each parameter can be either a string or a regex */ public HttpRequest withQueryStringParameters(Map<String, List<String>> parameters) { this.queryStringParameters.withEntries(parameters); return this; }
@Override public void serialize(ParameterBodyDTO parameterBodyDTO, JsonGenerator jgen, SerializerProvider provider) throws IOException { jgen.writeStartObject(); if (parameterBodyDTO.getNot() != null && parameterBodyDTO.getNot()) { jgen.writeBooleanField("not", parameterBodyDTO.getNot()); } jgen.writeStringField("type", parameterBodyDTO.getType().name()); if (!parameterBodyDTO.getParameters().isEmpty()) { jgen.writeObjectField("parameters", parameterBodyDTO.getParameters()); } jgen.writeEndObject(); } }
/** * Adds one query string parameter to match which can specified using plain strings or regular expressions * (for more details of the supported regex syntax see http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html) * * @param name the parameter name * @param values the parameter values which can be a varags of strings or regular expressions */ public HttpRequest withQueryStringParameter(String name, String... values) { this.queryStringParameters.withEntry(name, values); return this; }
@Override public String toString() { StringBuilder body = new StringBuilder(); List<Parameter> bodyParameters = this.parameters.getEntries(); for (int i = 0; i < bodyParameters.size(); i++) { Parameter parameter = bodyParameters.get(i);
public HttpRequest clone() { return not(request(), not) .withMethod(method) .withPath(path) .withQueryStringParameters(getQueryStringParameters().clone()) .withBody(body) .withHeaders(getHeaders().clone()) .withCookies(getCookies().clone()) .withKeepAlive(keepAlive) .withSecure(secure); }
@Override public Parameters build() { return new Parameters(); } }
public String getFirstQueryStringParameter(String name) { return this.queryStringParameters.getFirstValue(name); }
public HttpRequest update(HttpRequest replaceRequest) { if (!Strings.isNullOrEmpty(replaceRequest.getMethod().getValue())) { withMethod(replaceRequest.getMethod()); } if (!Strings.isNullOrEmpty(replaceRequest.getPath().getValue())) { withPath(replaceRequest.getPath()); } for (Header header : replaceRequest.getHeaderList()) { getHeaders().replaceEntry(header); } for (Cookie cookie : replaceRequest.getCookieList()) { withCookie(cookie); } for (Parameter parameter : replaceRequest.getQueryStringParameterList()) { getQueryStringParameters().replaceEntry(parameter); } if (replaceRequest.getBody() != null) { withBody(replaceRequest.getBody()); } if (replaceRequest.isSecure() != null) { withSecure(replaceRequest.isSecure()); } if (replaceRequest.isKeepAlive() != null) { withKeepAlive(replaceRequest.isKeepAlive()); } return this; } }
public ParameterBody(List<Parameter> parameters) { this(new Parameters().withEntries(parameters)); }