reduce code smells

This commit is contained in:
2025-03-24 15:49:43 +01:00
parent d8726e5e64
commit 08a5606da6
3 changed files with 9 additions and 9 deletions
@@ -48,12 +48,12 @@ abstract class CfBasicHttpClient {
}
private ObjectMapper initObjectMapper() {
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.registerModule(new JavaTimeModule());
objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
objectMapper.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE);
return objectMapper;
ObjectMapper mapper = new ObjectMapper();
mapper.registerModule(new JavaTimeModule());
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
mapper.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE);
return mapper;
}
private CloseableHttpClient createHttpClient() {
@@ -52,7 +52,7 @@ public enum CfRequest {
*/
RECORD_DELETE("/zones/%s/dns_records/%s");
private static final char varIdentification = '%';
private static final char VAR_IDENTIFICATION = '%';
private final String path;
CfRequest(String path) {
@@ -68,7 +68,7 @@ public enum CfRequest {
* @return the fully constructed API endpoint path as a string.
*/
String buildPath(Object... vars) {
long varCount = path.chars().filter(c -> c == varIdentification).count();
long varCount = path.chars().filter(c -> c == VAR_IDENTIFICATION).count();
if (varCount != vars.length) {
throw new IllegalArgumentException(
String.format(
@@ -39,7 +39,7 @@ public abstract class AbstractMultipleResponse<T extends ResponseEntity> extends
* constructor of the superclass {@code AbstractResponse}. This constructor is typically used for
* deserialization or subclass instantiation.
*/
public AbstractMultipleResponse() {
AbstractMultipleResponse() {
super();
}
}