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

Code cleaning #51

Merged
merged 3 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
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 @@ -94,6 +94,10 @@ public static Builder builder() {
return new Builder();
}

public static Builder builder(ActiveNumberListRequestParameters parameters) {
return new Builder(parameters);
}

public static class Builder {

OptionalValue<String> regionCode = OptionalValue.empty();
Expand All @@ -106,7 +110,7 @@ public static class Builder {

private Builder() {}

public Builder(ActiveNumberListRequestParameters parameters) {
private Builder(ActiveNumberListRequestParameters parameters) {
parameters.regionCode.ifPresent(this::setRegionCode);
parameters.type.ifPresent(this::setType);
parameters.numberPattern.ifPresent(this::setNumberPattern);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public ActiveNumberListResponse nextPage() {
throw new NoSuchElementException("Reached the last page of the API response");
}
ActiveNumberListRequestParameters.Builder newParameters =
new ActiveNumberListRequestParameters.Builder(page.getParameters());
ActiveNumberListRequestParameters.builder(page.getParameters());
newParameters.setPageToken(page.getNextPageToken());
return service.list(newParameters.build());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

public class Parameters extends HashMap<String, Parameters.Entry> {

private static final long serialVersionUID = 1L;

public Parameters(Collection<Parameters.Entry> list) {
super(list.stream().collect(Collectors.toMap(entry -> entry.key, entry -> entry)));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
/** Sinch Client exception related to payload parsing/mapping error */
public class ApiMappingException extends ApiException {

private static final long serialVersionUID = 1L;

/**
* Exception throw when parsing a payload was causing an issue
*
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/com/sinch/sdk/core/utils/databind/Mapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ public void serializeAsField(

private static class FilteringIntrospection extends JacksonAnnotationIntrospector {

private static final long serialVersionUID = 1L;

@Override
public Object findFilterId(Annotated ac) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,9 @@ public UninitializedFilterSerialization setOptional(String value) {

@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public static class HashMapSerialization extends HashMap<String, Object> {}
public static class HashMapSerialization extends HashMap<String, Object> {
private static final long serialVersionUID = 1L;
}

public static class DefaultSerialization {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class ActiveNumberDto {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_PHONE_NUMBER = "phoneNumber";
private String phoneNumber;
private boolean phoneNumberDefined = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class ActiveNumberRequestDto {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_DISPLAY_NAME = "displayName";
private String displayName;
private boolean displayNameDefined = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class ActiveNumbersResponseDto {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_ACTIVE_NUMBERS = "activeNumbers";
private List<ActiveNumberDto> activeNumbers;
private boolean activeNumbersDefined = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class AvailableNumberDto {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_PHONE_NUMBER = "phoneNumber";
private String phoneNumber;
private boolean phoneNumberDefined = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class AvailableNumbersResponseDto {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_AVAILABLE_NUMBERS = "availableNumbers";
private List<AvailableNumberDto> availableNumbers;
private boolean availableNumbersDefined = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class AvailableRegionDto {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_REGION_CODE = "regionCode";
private String regionCode;
private boolean regionCodeDefined = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class BadRequestDto {
private static final long serialVersionUID = 1L;

/** Gets or Sets type */
public enum TypeEnum {
BADREQUEST("BadRequest"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class CallbackConfigurationDto {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_PROJECT_ID = "projectId";
private String projectId;
private boolean projectIdDefined = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class CallbackConfigurationUpdateDto {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_HMAC_SECRET = "hmacSecret";
private String hmacSecret;
private boolean hmacSecretDefined = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class CallbackPayloadDto {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_EVENT_ID = "eventId";
private String eventId;
private boolean eventIdDefined = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class FieldViolationDto {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_FIELD = "field";
private String field;
private boolean fieldDefined = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class InternalErrorDto {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_ERROR = "error";
private InternalErrorErrorDto error;
private boolean errorDefined = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class InternalErrorErrorDto {
private static final long serialVersionUID = 1L;

/** Gets or Sets code */
public enum CodeEnum {
NUMBER_500(500),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class InvalidArgumentDto {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_ERROR = "error";
private InvalidArgumentErrorDto error;
private boolean errorDefined = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class InvalidArgumentErrorDto {
private static final long serialVersionUID = 1L;

/** Gets or Sets code */
public enum CodeEnum {
NUMBER_400(400),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class ListAvailableNumberRequestDto {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_NUMBER_PATTERN = "NumberPattern";
private NumberPatternPatternDto numberPattern;
private boolean numberPatternDefined = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class ListAvailableRegionsResponseDto {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_AVAILABLE_REGIONS = "availableRegions";
private List<AvailableRegionDto> availableRegions;
private boolean availableRegionsDefined = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class MoneyDto {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_CURRENCY_CODE = "currencyCode";
private String currencyCode;
private boolean currencyCodeDefined = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class NotFoundDto {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_ERROR = "error";
private NotFoundErrorDto error;
private boolean errorDefined = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class NotFoundErrorDto {
private static final long serialVersionUID = 1L;

/** Gets or Sets code */
public enum CodeEnum {
NUMBER_404(404),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class NumberPatternPatternDto {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_NUMBER_PATTERN = "NumberPattern";
private SearchPatternDto numberPattern;
private boolean numberPatternDefined = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class NumberPatternSearchPatternDto {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_NUMBER_PATTERN_SEARCH_PATTERN =
"NumberPatternSearchPattern";
private String numberPatternSearchPattern;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class RentAnyNumberRequestDto {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_REGION_CODE = "regionCode";
private String regionCode;
private boolean regionCodeDefined = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class RentAnyNumberRequestSmsConfigurationDto {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_SERVICE_PLAN_ID = "servicePlanId";
private String servicePlanId;
private boolean servicePlanIdDefined = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class RentAnyNumberRequestVoiceConfigurationDto {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_APP_ID = "appId";
private String appId;
private boolean appIdDefined = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class RentNumberRequestDto {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_SMS_CONFIGURATION = "smsConfiguration";
private RentAnyNumberRequestSmsConfigurationDto smsConfiguration;
private boolean smsConfigurationDefined = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class SMSConfigurationDto {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_SERVICE_PLAN_ID = "servicePlanId";
private String servicePlanId;
private boolean servicePlanIdDefined = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class ScheduledProvisioningDto {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_SERVICE_PLAN_ID = "servicePlanId";
private String servicePlanId;
private boolean servicePlanIdDefined = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class ScheduledVoiceProvisioningDto {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_APP_ID = "appId";
private String appId;
private boolean appIdDefined = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class SearchPatternDto {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_PATTERN = "pattern";
private String pattern;
private boolean patternDefined = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class VoiceConfigurationDto {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_APP_ID = "appId";
private String appId;
private boolean appIdDefined = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class AddKeywordDto {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_FIRST_WORD = "first_word";
private String firstWord;
private boolean firstWordDefined = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@

@JsonDeserialize(using = ApiBatchListBatchesInnerDto.ApiBatchListBatchesInnerDtoDeserializer.class)
@JsonSerialize(using = ApiBatchListBatchesInnerDto.ApiBatchListBatchesInnerDtoSerializer.class)
public class ApiBatchListBatchesInnerDto extends AbstractOpenApiSchema {
public final class ApiBatchListBatchesInnerDto extends AbstractOpenApiSchema {
private static final Logger log = Logger.getLogger(ApiBatchListBatchesInnerDto.class.getName());

public static class ApiBatchListBatchesInnerDtoSerializer
public static final class ApiBatchListBatchesInnerDtoSerializer
extends StdSerializer<ApiBatchListBatchesInnerDto> {
private static final long serialVersionUID = 1L;

public ApiBatchListBatchesInnerDtoSerializer(Class<ApiBatchListBatchesInnerDto> t) {
super(t);
}
Expand All @@ -59,8 +61,11 @@ public void serialize(
}
}

public static class ApiBatchListBatchesInnerDtoDeserializer
public static final class ApiBatchListBatchesInnerDtoDeserializer
extends StdDeserializer<ApiBatchListBatchesInnerDto> {

private static final long serialVersionUID = 1L;

public ApiBatchListBatchesInnerDtoDeserializer() {
this(ApiBatchListBatchesInnerDto.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class ApiBatchListDto {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_COUNT = "count";
private Long count;
private boolean countDefined = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class ApiDeliveryFeedbackDto {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_RECIPIENTS = "recipients";
private List<String> recipients;
private boolean recipientsDefined = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class ApiGroupAutoUpdateDto {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_TO = "to";
private String to;
private boolean toDefined = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class ApiGroupDto {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_ID = "id";
private String id;
private boolean idDefined = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
@JsonFilter("uninitializedFilter")
@JsonInclude(value = JsonInclude.Include.CUSTOM)
public class ApiGroupListDto {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_COUNT = "count";
private Long count;
private boolean countDefined = false;
Expand Down
Loading
Loading