reduce code smells
This commit is contained in:
@@ -48,12 +48,12 @@ abstract class CfBasicHttpClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private ObjectMapper initObjectMapper() {
|
private ObjectMapper initObjectMapper() {
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
objectMapper.registerModule(new JavaTimeModule());
|
mapper.registerModule(new JavaTimeModule());
|
||||||
objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
||||||
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||||
objectMapper.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE);
|
mapper.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE);
|
||||||
return objectMapper;
|
return mapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
private CloseableHttpClient createHttpClient() {
|
private CloseableHttpClient createHttpClient() {
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ public enum CfRequest {
|
|||||||
*/
|
*/
|
||||||
RECORD_DELETE("/zones/%s/dns_records/%s");
|
RECORD_DELETE("/zones/%s/dns_records/%s");
|
||||||
|
|
||||||
private static final char varIdentification = '%';
|
private static final char VAR_IDENTIFICATION = '%';
|
||||||
private final String path;
|
private final String path;
|
||||||
|
|
||||||
CfRequest(String path) {
|
CfRequest(String path) {
|
||||||
@@ -68,7 +68,7 @@ public enum CfRequest {
|
|||||||
* @return the fully constructed API endpoint path as a string.
|
* @return the fully constructed API endpoint path as a string.
|
||||||
*/
|
*/
|
||||||
String buildPath(Object... vars) {
|
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) {
|
if (varCount != vars.length) {
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
String.format(
|
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
|
* constructor of the superclass {@code AbstractResponse}. This constructor is typically used for
|
||||||
* deserialization or subclass instantiation.
|
* deserialization or subclass instantiation.
|
||||||
*/
|
*/
|
||||||
public AbstractMultipleResponse() {
|
AbstractMultipleResponse() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user