org.mockserver.model.Parameter 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.Arrays;
import java.util.Collection;
import static org.mockserver.model.NottableOptionalString.optionalString;
import static org.mockserver.model.NottableString.string;
/**
* @author jamesdbloom
*/
public class Parameter extends KeyToMultiValue {
public Parameter(String name, String... value) {
super(name, value);
}
public Parameter(NottableString name, NottableString... value) {
super(name, value);
}
public Parameter(String name, Collection value) {
super(name, value);
}
public Parameter(NottableString name, Collection value) {
super(name, value);
}
public static Parameter param(String name, String... value) {
return new Parameter(name, value);
}
public static Parameter param(NottableString name, NottableString... value) {
return new Parameter(name, value);
}
public static Parameter param(String name, Collection value) {
return new Parameter(name, value);
}
public static Parameter param(NottableString name, Collection value) {
return new Parameter(name, value);
}
public static Parameter schemaParam(String name, String... values) {
return new Parameter(string(name), Arrays.stream(values).map(NottableSchemaString::schemaString).toArray(NottableString[]::new));
}
public static Parameter schemaParam(NottableString name, String... values) {
return new Parameter(name, Arrays.stream(values).map(NottableSchemaString::schemaString).toArray(NottableString[]::new));
}
public static Parameter optionalParam(String name, String... values) {
return new Parameter(optionalString(name), Arrays.stream(values).map(NottableString::string).toArray(NottableString[]::new));
}
public Parameter withStyle(ParameterStyle style) {
getName().withStyle(style);
return this;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy