public class ThreadFixInterface {
private ThreadFixInterface(){}
public static EndpointQuery toEndpointQuery(Finding finding) {
EndpointQueryBuilder builder = EndpointQueryBuilder.start();
SurfaceLocation location = finding.getSurfaceLocation();
if (location != null) {
if (location.getHttpMethod() != null) {
builder.setHttpMethod(location.getHttpMethod());
}
if (location.getPath() != null) {
builder.setDynamicPath(location.getPath());
}
if (location.getParameter() != null) {
builder.setParameter(location.getParameter());
}
}
if (finding.getIsStatic()) {
builder.setInformationSourceType(InformationSourceType.STATIC);
} else {
builder.setInformationSourceType(InformationSourceType.DYNAMIC);
}
if (finding.getSourceFileLocation() != null) {
builder.setStaticPath(finding.getSourceFileLocation());
}
if (finding.getDataFlowElements() != null && !finding.getDataFlowElements().isEmpty()) {
builder.setCodePoints(toCodePoints(finding.getDataFlowElements()));
}
return builder.generateQuery();
}