Skip to content

Commit

Permalink
[MOSIP-37358] Readme
Browse files Browse the repository at this point in the history
Signed-off-by: JanardhanBS-SyncByte <[email protected]>
  • Loading branch information
JanardhanBS-SyncByte committed Nov 12, 2024
1 parent 345140b commit c4e227f
Showing 1 changed file with 43 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package io.mosip.kernel.bio.converter.dto;

import java.util.Map;
import java.util.Objects;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import lombok.Data;
import lombok.ToString;

/**
* Data Transfer Object for conversion requests in the bio converter service.
Expand Down Expand Up @@ -35,6 +37,7 @@
*/

@Data
@ToString
public class ConvertRequestDto {
/**
* A map of values required for the conversion. The map must contain at least
Expand Down Expand Up @@ -73,4 +76,43 @@ public class ConvertRequestDto {
*/
@SuppressWarnings({ "java:S1104" })
public Map<String, String> targetParameters;
}

public ConvertRequestDto() {
super();
}

public ConvertRequestDto(
@NotNull(message = "Values code can not be null") @Size(min = 1, message = "Minimum one entry required") Map<String, String> values,
@NotNull(message = "SourceFormat code can not be null") @NotBlank(message = "SourceFormat code can not be blank") @NotEmpty(message = "SourceFormat code can not be empty") String sourceFormat,
@NotNull(message = "TargetFormat code can not be null") @NotBlank(message = "TargetFormat code can not be blank") @NotEmpty(message = "TargetFormat code can not be empty") String targetFormat,
Map<String, String> sourceParameters, Map<String, String> targetParameters) {
super();
this.values = values;
this.sourceFormat = sourceFormat;
this.targetFormat = targetFormat;
this.sourceParameters = sourceParameters;
this.targetParameters = targetParameters;
}

@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
ConvertRequestDto that = (ConvertRequestDto) o;
return Objects.equals(values, that.values) && Objects.equals(sourceFormat, that.sourceFormat)
&& Objects.equals(targetFormat, that.targetFormat)
&& Objects.equals(sourceParameters, that.sourceParameters)
&& Objects.equals(targetParameters, that.targetParameters);
}

@Override
public int hashCode() {
return Objects.hash(values, sourceFormat, targetFormat, sourceParameters, targetParameters);
}

public boolean canEqual(Object other) {
return other instanceof ConvertRequestDto;
}
}

0 comments on commit c4e227f

Please sign in to comment.