The relevant class is ConfigTestElement which can be initialized as follows:
ConfigTestElement httpRequestDefaults = new ConfigTestElement();
httpRequestDefaults.setName("HTTP Request Defaults");
httpRequestDefaults.setProperty(new TestElementProperty("HTTPsampler.Arguments", new HTTPArgumentsPanel().createTestElement()));
httpRequestDefaults.setProperty("HTTPSampler.domain", "hostname or IP address of your server");
httpRequestDefaults.setProperty("HTTPSampler.port", "1234");
httpRequestDefaults.setProperty("HTTPSampler.protocol", "https");
httpRequestDefaults.setProperty("HTTPSampler.contentEncoding", "UTF-8");
httpRequestDefaults.setProperty("HTTPSampler.path", "/");
httpRequestDefaults.setProperty("HTTPSampler.concurrentPool", "6");
httpRequestDefaults.setProperty("HTTPSampler.connect_timeout", "10000");
httpRequestDefaults.setProperty("HTTPSampler.response_timeout", "10000");
httpRequestDefaults.setProperty(TestElement.TEST_CLASS, ConfigTestElement.class.getName());
httpRequestDefaults.setProperty(TestElement.GUI_CLASS, HttpDefaultsGui.class.getName());
Replace the properties with the values of your choice including eventual default parameters.
References: