Skip to content
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 @@ -45,7 +45,7 @@ public class ImagesField {

@SerializedName(SERIALIZED_NAME_FIELD_TYPE)
@javax.annotation.Nonnull
private GraphicFieldType fieldType;
private Integer fieldType;

public static final String SERIALIZED_NAME_VALUE_LIST = "valueList";

Expand Down Expand Up @@ -80,22 +80,22 @@ public void setFieldName(@javax.annotation.Nonnull String fieldName) {
this.fieldName = fieldName;
}

public ImagesField fieldType(@javax.annotation.Nonnull GraphicFieldType fieldType) {
public ImagesField fieldType(@javax.annotation.Nonnull Integer fieldType) {
this.fieldType = fieldType;
return this;
}

/**
* Get fieldType
* The value can be from GraphicFieldType or TextFieldType enum.
*
* @return fieldType
*/
@javax.annotation.Nonnull
public GraphicFieldType getFieldType() {
public Integer getFieldType() {
return fieldType;
}

public void setFieldType(@javax.annotation.Nonnull GraphicFieldType fieldType) {
public void setFieldType(@javax.annotation.Nonnull Integer fieldType) {
this.fieldType = fieldType;
}

Expand Down Expand Up @@ -238,8 +238,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
"Expected the field `fieldName` to be a primitive type in the JSON string but got `%s`",
jsonObj.get("fieldName").toString()));
}
// validate the required field `fieldType`
GraphicFieldType.validateJsonElement(jsonObj.get("fieldType"));
// ensure the json data is an array
if (!jsonObj.get("valueList").isJsonArray()) {
throw new IllegalArgumentException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public Images withFieldList(List<ImagesField> fieldList) {
@Nullable
public ImagesField getField(GraphicFieldType fieldType) {
for (com.regula.documentreader.webclient.model.ImagesField field : getFieldList()) {
if (field.getFieldType() == fieldType) {
if (field.getFieldType().equals(fieldType.getValue())) {
return new ImagesField(field);
}
}
Expand All @@ -57,7 +57,7 @@ public ImagesField getField(GraphicFieldType fieldType) {
public List<ImagesField> getFields(int fieldType) {
List<ImagesField> fields = new ArrayList<>();
for (com.regula.documentreader.webclient.model.ImagesField field : getFieldList()) {
if (field.getFieldType().getValue() == fieldType) {
if (field.getFieldType() == fieldType) {
fields.add(new ImagesField(field));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public ImagesField withFieldName(String fieldName) {
}

public ImagesField withFieldType(GraphicFieldType fieldType) {
this.setFieldType(fieldType);
this.setFieldType(fieldType.getValue());
return this;
}

Expand Down