Skip to content

Commit 4e40df1

Browse files
committed
cleanup authenticity, add measure system
1 parent 3744855 commit 4e40df1

File tree

14 files changed

+129
-122
lines changed

14 files changed

+129
-122
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Regula Document Reader Web API
3+
* Documents recognition as easy as reading two bytes. # Clients: * [JavaScript](https://github.com/regulaforensics/DocumentReader-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/DocumentReader-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/DocumentReader-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/DocumentReader-web-csharp-client) client for .NET & .NET Core
4+
*
5+
* The version of the OpenAPI document: 5.5.0
6+
*
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9+
* https://openapi-generator.tech
10+
* Do not edit the class manually.
11+
*/
12+
13+
package com.regula.documentreader.webclient.model;
14+
15+
public class MeasureSystem {
16+
17+
/** Metric system of measurement, where things are measured in meters and grams */
18+
public static final int METRIC = 0;
19+
20+
/** Imperial System of Measurement, where things are measured in feet, inches and pounds */
21+
public static final int IMPERIAL = 1;
22+
}

client/src/main/generated/com/regula/documentreader/webclient/model/OriginalSymbol.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class OriginalSymbol {
2020
public static final String SERIALIZED_NAME_CODE = "code";
2121

2222
@SerializedName(SERIALIZED_NAME_CODE)
23-
private Integer code;
23+
private Long code;
2424

2525
public static final String SERIALIZED_NAME_PROBABILITY = "probability";
2626

@@ -32,7 +32,7 @@ public class OriginalSymbol {
3232
@SerializedName(SERIALIZED_NAME_RECT)
3333
private RectangleCoordinates rect;
3434

35-
public OriginalSymbol withCode(Integer code) {
35+
public OriginalSymbol withCode(Long code) {
3636
this.code = code;
3737
return this;
3838
}
@@ -43,11 +43,11 @@ public OriginalSymbol withCode(Integer code) {
4343
* @return code
4444
*/
4545
@javax.annotation.Nullable
46-
public Integer getCode() {
46+
public Long getCode() {
4747
return code;
4848
}
4949

50-
public void setCode(Integer code) {
50+
public void setCode(Long code) {
5151
this.code = code;
5252
}
5353

client/src/main/generated/com/regula/documentreader/webclient/model/ProcessParams.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ public class ProcessParams {
4646
@SerializedName(SERIALIZED_NAME_DATE_FORMAT)
4747
private String dateFormat;
4848

49+
public static final String SERIALIZED_NAME_MEASURE_SYSTEM = "measureSystem";
50+
51+
@SerializedName(SERIALIZED_NAME_MEASURE_SYSTEM)
52+
private Integer measureSystem;
53+
4954
public static final String SERIALIZED_NAME_IMAGE_DPI_OUT_MAX = "imageDpiOutMax";
5055

5156
@SerializedName(SERIALIZED_NAME_IMAGE_DPI_OUT_MAX)
@@ -220,6 +225,25 @@ public void setDateFormat(String dateFormat) {
220225
this.dateFormat = dateFormat;
221226
}
222227

228+
public ProcessParams withMeasureSystem(Integer measureSystem) {
229+
this.measureSystem = measureSystem;
230+
return this;
231+
}
232+
233+
/**
234+
* Get measureSystem
235+
*
236+
* @return measureSystem
237+
*/
238+
@javax.annotation.Nullable
239+
public Integer getMeasureSystem() {
240+
return measureSystem;
241+
}
242+
243+
public void setMeasureSystem(Integer measureSystem) {
244+
this.measureSystem = measureSystem;
245+
}
246+
223247
public ProcessParams withImageDpiOutMax(Integer imageDpiOutMax) {
224248
this.imageDpiOutMax = imageDpiOutMax;
225249
return this;
@@ -463,6 +487,7 @@ public boolean equals(java.lang.Object o) {
463487
&& Objects.equals(this.doublePageSpread, processParams.doublePageSpread)
464488
&& Objects.equals(this.fieldTypesFilter, processParams.fieldTypesFilter)
465489
&& Objects.equals(this.dateFormat, processParams.dateFormat)
490+
&& Objects.equals(this.measureSystem, processParams.measureSystem)
466491
&& Objects.equals(this.imageDpiOutMax, processParams.imageDpiOutMax)
467492
&& Objects.equals(this.alreadyCropped, processParams.alreadyCropped)
468493
&& Objects.equals(this.customParams, processParams.customParams)
@@ -485,6 +510,7 @@ public int hashCode() {
485510
doublePageSpread,
486511
fieldTypesFilter,
487512
dateFormat,
513+
measureSystem,
488514
imageDpiOutMax,
489515
alreadyCropped,
490516
customParams,
@@ -507,6 +533,7 @@ public String toString() {
507533
sb.append(" doublePageSpread: ").append(toIndentedString(doublePageSpread)).append("\n");
508534
sb.append(" fieldTypesFilter: ").append(toIndentedString(fieldTypesFilter)).append("\n");
509535
sb.append(" dateFormat: ").append(toIndentedString(dateFormat)).append("\n");
536+
sb.append(" measureSystem: ").append(toIndentedString(measureSystem)).append("\n");
510537
sb.append(" imageDpiOutMax: ").append(toIndentedString(imageDpiOutMax)).append("\n");
511538
sb.append(" alreadyCropped: ").append(toIndentedString(alreadyCropped)).append("\n");
512539
sb.append(" customParams: ").append(toIndentedString(customParams)).append("\n");

client/src/main/generated/com/regula/documentreader/webclient/model/ProcessResponse.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public ProcessResponse withChipPage(Integer chipPage) {
5959
*
6060
* @return chipPage
6161
*/
62+
@javax.annotation.Nullable
6263
public Integer getChipPage() {
6364
return chipPage;
6465
}

client/src/main/java/com/regula/documentreader/webclient/model/ext/RecognitionResponse.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ public Images images() {
5353

5454
@Nullable
5555
public Authenticity authenticity() {
56-
AuthenticityResult result = resultByType(Result.AUTHENTICITY);
56+
return authenticity(0);
57+
}
58+
59+
@Nullable
60+
public Authenticity authenticity(int page_idx) {
61+
AuthenticityResult result = getResult(Result.AUTHENTICITY, page_idx);
5762
if (result != null) {
5863
return result.getAuthenticityCheckList();
5964
}
@@ -69,6 +74,15 @@ public <R> R resultByType(int type) {
6974
return null;
7075
}
7176

77+
public <R> R getResult(int type, int page_idx) {
78+
for (ResultItem item : originalResponse.getContainerList().getList()) {
79+
if (item.getResultType() == type && item.getPageIdx() == page_idx) {
80+
return (R) item;
81+
}
82+
}
83+
return null;
84+
}
85+
7286
public <R> List<R> resultsByType(int type) {
7387
List<R> results = new ArrayList<>();
7488
for (ResultItem item : originalResponse.getContainerList().getList()) {

client/src/main/java/com/regula/documentreader/webclient/model/ext/authenticity/Authenticity.java

Lines changed: 42 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,144 +1,88 @@
11
package com.regula.documentreader.webclient.model.ext.authenticity;
22

33
import com.regula.documentreader.webclient.model.AuthenticityCheckResult;
4+
import com.regula.documentreader.webclient.model.AuthenticityResultType;
45
import javax.annotation.Nullable;
56

67
public class Authenticity extends com.regula.documentreader.webclient.model.AuthenticityCheckList {
78

89
@Nullable
9-
public SecurityFeature uvLuminescence() {
10-
int uvLuminescenceType = 1;
11-
return this.securityFeatureOrNull(uvLuminescenceType);
10+
public SecurityFeatureChecks uvLuminescenceChecks() {
11+
return this.securityFeatureOrNull(AuthenticityResultType.UV_LUMINESCENCE);
1212
}
1313

1414
@Nullable
15-
public SecurityFeature irB900() {
16-
int irB900Type = 2;
17-
return this.securityFeatureOrNull(irB900Type);
15+
public SecurityFeatureChecks irB900Checks() {
16+
return this.securityFeatureOrNull(AuthenticityResultType.IR_B900);
1817
}
1918

2019
@Nullable
21-
public Ident imagePattern() {
22-
int imagePatternType = 4;
23-
return this.identOrNull(imagePatternType);
20+
public IdentChecks imagePatternChecks() {
21+
return this.identOrNull(AuthenticityResultType.IMAGE_PATTERN);
2422
}
2523

2624
@Nullable
27-
public SecurityFeature axialProtection() {
28-
int axialProtectionType = 8;
29-
return this.securityFeatureOrNull(axialProtectionType);
25+
public SecurityFeatureChecks axialProtectionChecks() {
26+
return this.securityFeatureOrNull(AuthenticityResultType.AXIAL_PROTECTION);
3027
}
3128

3229
@Nullable
33-
public Fiber uvFiber() {
34-
int uvFiberType = 16;
35-
return this.fiberOrNull(uvFiberType);
30+
public FiberChecks uvFiberChecks() {
31+
return this.fiberOrNull(AuthenticityResultType.UV_FIBERS);
3632
}
3733

3834
@Nullable
39-
public Ident irVisibility() {
40-
int irVisibilityType = 32;
41-
return this.identOrNull(irVisibilityType);
35+
public IdentChecks irVisibilityChecks() {
36+
return this.identOrNull(AuthenticityResultType.IR_VISIBILITY);
4237
}
4338

4439
@Nullable
45-
public OCRSecurityText ocrSecurityText() {
46-
int ocrSecurityTextType = 64;
47-
return this.ocrSecurityTextOrNull(ocrSecurityTextType);
40+
public OCRSecurityTextChecks ocrSecurityTextChecks() {
41+
return this.ocrSecurityTextOrNull(AuthenticityResultType.OCR_SECURITY_TEXT);
4842
}
4943

5044
@Nullable
51-
public ImageIdent ipi() {
52-
int ipiType = 128;
53-
return this.imageIdentOrNull(ipiType);
45+
public ImageIdentChecks ipiChecks() {
46+
return this.imageIdentOrNull(AuthenticityResultType.IPI);
5447
}
5548

5649
@Nullable
57-
public ImageIdent irImage() {
58-
int irImageType = 256;
59-
return this.imageIdentOrNull(irImageType);
50+
public SecurityFeatureChecks embedImageChecks() {
51+
return this.securityFeatureOrNull(AuthenticityResultType.PHOTO_EMBED_TYPE);
6052
}
6153

6254
@Nullable
63-
public SecurityFeature embedImage() {
64-
int embedImageType = 512;
65-
return this.securityFeatureOrNull(embedImageType);
55+
public SecurityFeatureChecks hologramsChecks() {
56+
return this.securityFeatureOrNull(AuthenticityResultType.HOLOGRAMS);
6657
}
6758

6859
@Nullable
69-
public Ident ovi() {
70-
int oviType = 1024;
71-
return this.identOrNull(oviType);
60+
public SecurityFeatureChecks imageAreaChecks() {
61+
return this.securityFeatureOrNull(AuthenticityResultType.PHOTO_AREA);
7262
}
7363

7464
@Nullable
75-
public Ident irLuminescence() {
76-
int irLuminescenceType = 2048;
77-
return this.identOrNull(irLuminescenceType);
65+
public IdentChecks portraitComparisonChecks() {
66+
return this.identOrNull(AuthenticityResultType.PORTRAIT_COMPARISON);
7867
}
7968

8069
@Nullable
81-
public SecurityFeature holograms() {
82-
int hologramsType = 4096;
83-
return this.securityFeatureOrNull(hologramsType);
70+
public SecurityFeatureChecks barcodeFormatCheckChecks() {
71+
return this.securityFeatureOrNull(AuthenticityResultType.BARCODE_FORMAT_CHECK);
8472
}
8573

8674
@Nullable
87-
public SecurityFeature imageArea() {
88-
int imageAreaType = 8192;
89-
return this.securityFeatureOrNull(imageAreaType);
75+
public IdentChecks kinegramChecks() {
76+
return this.identOrNull(AuthenticityResultType.KINEGRAM);
9077
}
9178

9279
@Nullable
93-
public Fiber uvBackground() {
94-
int uvBackgroundType = 16384;
95-
return this.fiberOrNull(uvBackgroundType);
80+
public IdentChecks letterScreenChecks() {
81+
return this.identOrNull(AuthenticityResultType.LETTER_SCREEN);
9682
}
9783

9884
@Nullable
99-
public Ident portraitComparison() {
100-
int portraitComparisonType = 32768;
101-
return this.identOrNull(portraitComparisonType);
102-
}
103-
104-
@Nullable
105-
public SecurityFeature barcodeFormatCheck() {
106-
int barcodeFormatCheckType = 65536;
107-
return this.securityFeatureOrNull(barcodeFormatCheckType);
108-
}
109-
110-
@Nullable
111-
public Ident kinegram() {
112-
int kinegramType = 131072;
113-
return this.identOrNull(kinegramType);
114-
}
115-
116-
@Nullable
117-
public Ident letterScreen() {
118-
int letterScreenType = 262144;
119-
return this.identOrNull(letterScreenType);
120-
}
121-
122-
@Nullable
123-
public Ident hologramsDetection() {
124-
int hologramsDetectionType = 524288;
125-
return this.identOrNull(hologramsDetectionType);
126-
}
127-
128-
@Nullable
129-
public Ident fingerprintComparison() {
130-
int fingerprintComparisonType = 1048576;
131-
return this.identOrNull(fingerprintComparisonType);
132-
}
133-
134-
@Nullable
135-
public SecurityFeature cancellingDocumentDetector() {
136-
int cancellingDocumentDetectorType = 2097152;
137-
return this.securityFeatureOrNull(cancellingDocumentDetectorType);
138-
}
139-
140-
@Nullable
141-
public AuthenticityCheckResult resultByType(int type) {
85+
private AuthenticityCheckResult resultByType(int type) {
14286
for (AuthenticityCheckResult checkResult : this.getList()) {
14387
if (checkResult.getType() == type) {
14488
return checkResult;
@@ -147,42 +91,42 @@ public AuthenticityCheckResult resultByType(int type) {
14791
return null;
14892
}
14993

150-
private Fiber fiberOrNull(int type) {
94+
private FiberChecks fiberOrNull(int type) {
15195
AuthenticityCheckResult result = this.resultByType(type);
15296
if (result != null) {
153-
return new Fiber(result);
97+
return new FiberChecks(result);
15498
}
15599
return null;
156100
}
157101

158-
private Ident identOrNull(int type) {
102+
private IdentChecks identOrNull(int type) {
159103
AuthenticityCheckResult result = this.resultByType(type);
160104
if (result != null) {
161-
return new Ident(result);
105+
return new IdentChecks(result);
162106
}
163107
return null;
164108
}
165109

166-
private ImageIdent imageIdentOrNull(int type) {
110+
private ImageIdentChecks imageIdentOrNull(int type) {
167111
AuthenticityCheckResult result = this.resultByType(type);
168112
if (result != null) {
169-
return new ImageIdent(result);
113+
return new ImageIdentChecks(result);
170114
}
171115
return null;
172116
}
173117

174-
private OCRSecurityText ocrSecurityTextOrNull(int type) {
118+
private OCRSecurityTextChecks ocrSecurityTextOrNull(int type) {
175119
AuthenticityCheckResult result = this.resultByType(type);
176120
if (result != null) {
177-
return new OCRSecurityText(result);
121+
return new OCRSecurityTextChecks(result);
178122
}
179123
return null;
180124
}
181125

182-
private SecurityFeature securityFeatureOrNull(int type) {
126+
private SecurityFeatureChecks securityFeatureOrNull(int type) {
183127
AuthenticityCheckResult result = this.resultByType(type);
184128
if (result != null) {
185-
return new SecurityFeature(result);
129+
return new SecurityFeatureChecks(result);
186130
}
187131
return null;
188132
}

client/src/main/java/com/regula/documentreader/webclient/model/ext/authenticity/AuthenticityResult.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public AuthenticityCheckResult payload() {
1515
}
1616

1717
public List<T> items() {
18+
//noinspection unchecked
1819
return (List<T>) this.authenticityCheckResult.getList();
1920
}
2021
}

0 commit comments

Comments
 (0)