Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IT]Adjust naming module base ITs for Checkstyle compliance. #12378

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,47 @@
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;

/**
* Helper class for building HTTP request parameters using Spring's MultiValueMap. Provides methods to construct and
* append parameters.
*/
public class Params {

private MultiValueMap<String, String> paramMap;

/**
* Private constructor to enforce usage of static factory method `newParams()`.
*/
private Params() {
this.paramMap = new LinkedMultiValueMap<>();
}

/**
* Static factory method to create a new instance of Params.
*
* @return A new Params instance.
*/
public static Params newParams() {
Params params = new Params();
params.paramMap = new LinkedMultiValueMap<String, String>();
return params;
return new Params();
}

/**
* Appends a parameter with the specified name and value to the parameter map.
*
* @param name The parameter name.
* @param value The parameter value.
* @return This Params instance for method chaining.
*/
public Params appendParam(String name, String value) {
this.paramMap.add(name, value);
return this;
}

/**
* Retrieves the constructed parameter map.
*
* @return The MultiValueMap containing the appended parameters.
*/
public MultiValueMap<String, String> done() {
return paramMap;
}
Expand Down
Loading