Compare commits

...

1 Commits

Author SHA1 Message Date
deiflaender
69eca3955d TEST: Added test that calls apryse.ai endoint and prints tables into documents 2023-07-25 16:34:46 +02:00
16 changed files with 5960 additions and 0 deletions

View File

@ -22,6 +22,18 @@
</properties>
<dependencies>
<dependency>
<groupId>org.jsonschema2pojo</groupId>
<artifactId>jsonschema2pojo-core</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents.client5</groupId>
<artifactId>httpclient5</artifactId>
<version>5.1.3</version>
</dependency>
<dependency>
<groupId>com.knecon.fforesight</groupId>
<artifactId>tenant-commons</artifactId>

View File

@ -0,0 +1,98 @@
package com.iqser.red.service.redaction.v1.server.apryse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.processing.Generated;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"pages"
})
@Generated("jsonschema2pojo")
public class ApryseAiResponse {
@JsonProperty("pages")
private List<Page> pages = new ArrayList<Page>();
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
@JsonProperty("pages")
public List<Page> getPages() {
return pages;
}
@JsonProperty("pages")
public void setPages(List<Page> pages) {
this.pages = pages;
}
public ApryseAiResponse withPages(List<Page> pages) {
this.pages = pages;
return this;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
public ApryseAiResponse withAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(ApryseAiResponse.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
sb.append("pages");
sb.append('=');
sb.append(((this.pages == null)?"<null>":this.pages));
sb.append(',');
sb.append("additionalProperties");
sb.append('=');
sb.append(((this.additionalProperties == null)?"<null>":this.additionalProperties));
sb.append(',');
if (sb.charAt((sb.length()- 1)) == ',') {
sb.setCharAt((sb.length()- 1), ']');
} else {
sb.append(']');
}
return sb.toString();
}
@Override
public int hashCode() {
int result = 1;
result = ((result* 31)+((this.pages == null)? 0 :this.pages.hashCode()));
result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode()));
return result;
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof ApryseAiResponse) == false) {
return false;
}
ApryseAiResponse rhs = ((ApryseAiResponse) other);
return (((this.pages == rhs.pages)||((this.pages!= null)&&this.pages.equals(rhs.pages)))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))));
}
}

View File

@ -0,0 +1,213 @@
package com.iqser.red.service.redaction.v1.server.apryse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.processing.Generated;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"rect",
"rowStart",
"rowEnd",
"columnStart",
"columnEnd",
"kids"
})
@Generated("jsonschema2pojo")
public class Cell {
@JsonProperty("rect")
private List<Double> rect = new ArrayList<Double>();
@JsonProperty("rowStart")
private Integer rowStart;
@JsonProperty("rowEnd")
private Integer rowEnd;
@JsonProperty("columnStart")
private Integer columnStart;
@JsonProperty("columnEnd")
private Integer columnEnd;
@JsonProperty("kids")
private List<Kid__2> kids = new ArrayList<Kid__2>();
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
@JsonProperty("rect")
public List<Double> getRect() {
return rect;
}
@JsonProperty("rect")
public void setRect(List<Double> rect) {
this.rect = rect;
}
public Cell withRect(List<Double> rect) {
this.rect = rect;
return this;
}
@JsonProperty("rowStart")
public Integer getRowStart() {
return rowStart;
}
@JsonProperty("rowStart")
public void setRowStart(Integer rowStart) {
this.rowStart = rowStart;
}
public Cell withRowStart(Integer rowStart) {
this.rowStart = rowStart;
return this;
}
@JsonProperty("rowEnd")
public Integer getRowEnd() {
return rowEnd;
}
@JsonProperty("rowEnd")
public void setRowEnd(Integer rowEnd) {
this.rowEnd = rowEnd;
}
public Cell withRowEnd(Integer rowEnd) {
this.rowEnd = rowEnd;
return this;
}
@JsonProperty("columnStart")
public Integer getColumnStart() {
return columnStart;
}
@JsonProperty("columnStart")
public void setColumnStart(Integer columnStart) {
this.columnStart = columnStart;
}
public Cell withColumnStart(Integer columnStart) {
this.columnStart = columnStart;
return this;
}
@JsonProperty("columnEnd")
public Integer getColumnEnd() {
return columnEnd;
}
@JsonProperty("columnEnd")
public void setColumnEnd(Integer columnEnd) {
this.columnEnd = columnEnd;
}
public Cell withColumnEnd(Integer columnEnd) {
this.columnEnd = columnEnd;
return this;
}
@JsonProperty("kids")
public List<Kid__2> getKids() {
return kids;
}
@JsonProperty("kids")
public void setKids(List<Kid__2> kids) {
this.kids = kids;
}
public Cell withKids(List<Kid__2> kids) {
this.kids = kids;
return this;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
public Cell withAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(Cell.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
sb.append("rect");
sb.append('=');
sb.append(((this.rect == null)?"<null>":this.rect));
sb.append(',');
sb.append("rowStart");
sb.append('=');
sb.append(((this.rowStart == null)?"<null>":this.rowStart));
sb.append(',');
sb.append("rowEnd");
sb.append('=');
sb.append(((this.rowEnd == null)?"<null>":this.rowEnd));
sb.append(',');
sb.append("columnStart");
sb.append('=');
sb.append(((this.columnStart == null)?"<null>":this.columnStart));
sb.append(',');
sb.append("columnEnd");
sb.append('=');
sb.append(((this.columnEnd == null)?"<null>":this.columnEnd));
sb.append(',');
sb.append("kids");
sb.append('=');
sb.append(((this.kids == null)?"<null>":this.kids));
sb.append(',');
sb.append("additionalProperties");
sb.append('=');
sb.append(((this.additionalProperties == null)?"<null>":this.additionalProperties));
sb.append(',');
if (sb.charAt((sb.length()- 1)) == ',') {
sb.setCharAt((sb.length()- 1), ']');
} else {
sb.append(']');
}
return sb.toString();
}
@Override
public int hashCode() {
int result = 1;
result = ((result* 31)+((this.rect == null)? 0 :this.rect.hashCode()));
result = ((result* 31)+((this.columnEnd == null)? 0 :this.columnEnd.hashCode()));
result = ((result* 31)+((this.columnStart == null)? 0 :this.columnStart.hashCode()));
result = ((result* 31)+((this.rowStart == null)? 0 :this.rowStart.hashCode()));
result = ((result* 31)+((this.rowEnd == null)? 0 :this.rowEnd.hashCode()));
result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode()));
result = ((result* 31)+((this.kids == null)? 0 :this.kids.hashCode()));
return result;
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof Cell) == false) {
return false;
}
Cell rhs = ((Cell) other);
return ((((((((this.rect == rhs.rect)||((this.rect!= null)&&this.rect.equals(rhs.rect)))&&((this.columnEnd == rhs.columnEnd)||((this.columnEnd!= null)&&this.columnEnd.equals(rhs.columnEnd))))&&((this.columnStart == rhs.columnStart)||((this.columnStart!= null)&&this.columnStart.equals(rhs.columnStart))))&&((this.rowStart == rhs.rowStart)||((this.rowStart!= null)&&this.rowStart.equals(rhs.rowStart))))&&((this.rowEnd == rhs.rowEnd)||((this.rowEnd!= null)&&this.rowEnd.equals(rhs.rowEnd))))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))))&&((this.kids == rhs.kids)||((this.kids!= null)&&this.kids.equals(rhs.kids))));
}
}

View File

@ -0,0 +1,236 @@
package com.iqser.red.service.redaction.v1.server.apryse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.processing.Generated;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"type",
"kids",
"confidence",
"rect",
"rowSeparators",
"columnSeparators",
"cells"
})
@Generated("jsonschema2pojo")
public class Element {
@JsonProperty("type")
private String type;
@JsonProperty("kids")
private List<Kid> kids = new ArrayList<Kid>();
@JsonProperty("confidence")
private Double confidence;
@JsonProperty("rect")
private List<Double> rect = new ArrayList<Double>();
@JsonProperty("rowSeparators")
private List<Double> rowSeparators = new ArrayList<Double>();
@JsonProperty("columnSeparators")
private List<Double> columnSeparators = new ArrayList<Double>();
@JsonProperty("cells")
private List<Cell> cells = new ArrayList<Cell>();
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
@JsonProperty("type")
public String getType() {
return type;
}
@JsonProperty("type")
public void setType(String type) {
this.type = type;
}
public Element withType(String type) {
this.type = type;
return this;
}
@JsonProperty("kids")
public List<Kid> getKids() {
return kids;
}
@JsonProperty("kids")
public void setKids(List<Kid> kids) {
this.kids = kids;
}
public Element withKids(List<Kid> kids) {
this.kids = kids;
return this;
}
@JsonProperty("confidence")
public Double getConfidence() {
return confidence;
}
@JsonProperty("confidence")
public void setConfidence(Double confidence) {
this.confidence = confidence;
}
public Element withConfidence(Double confidence) {
this.confidence = confidence;
return this;
}
@JsonProperty("rect")
public List<Double> getRect() {
return rect;
}
@JsonProperty("rect")
public void setRect(List<Double> rect) {
this.rect = rect;
}
public Element withRect(List<Double> rect) {
this.rect = rect;
return this;
}
@JsonProperty("rowSeparators")
public List<Double> getRowSeparators() {
return rowSeparators;
}
@JsonProperty("rowSeparators")
public void setRowSeparators(List<Double> rowSeparators) {
this.rowSeparators = rowSeparators;
}
public Element withRowSeparators(List<Double> rowSeparators) {
this.rowSeparators = rowSeparators;
return this;
}
@JsonProperty("columnSeparators")
public List<Double> getColumnSeparators() {
return columnSeparators;
}
@JsonProperty("columnSeparators")
public void setColumnSeparators(List<Double> columnSeparators) {
this.columnSeparators = columnSeparators;
}
public Element withColumnSeparators(List<Double> columnSeparators) {
this.columnSeparators = columnSeparators;
return this;
}
@JsonProperty("cells")
public List<Cell> getCells() {
return cells;
}
@JsonProperty("cells")
public void setCells(List<Cell> cells) {
this.cells = cells;
}
public Element withCells(List<Cell> cells) {
this.cells = cells;
return this;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
public Element withAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(Element.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
sb.append("type");
sb.append('=');
sb.append(((this.type == null)?"<null>":this.type));
sb.append(',');
sb.append("kids");
sb.append('=');
sb.append(((this.kids == null)?"<null>":this.kids));
sb.append(',');
sb.append("confidence");
sb.append('=');
sb.append(((this.confidence == null)?"<null>":this.confidence));
sb.append(',');
sb.append("rect");
sb.append('=');
sb.append(((this.rect == null)?"<null>":this.rect));
sb.append(',');
sb.append("rowSeparators");
sb.append('=');
sb.append(((this.rowSeparators == null)?"<null>":this.rowSeparators));
sb.append(',');
sb.append("columnSeparators");
sb.append('=');
sb.append(((this.columnSeparators == null)?"<null>":this.columnSeparators));
sb.append(',');
sb.append("cells");
sb.append('=');
sb.append(((this.cells == null)?"<null>":this.cells));
sb.append(',');
sb.append("additionalProperties");
sb.append('=');
sb.append(((this.additionalProperties == null)?"<null>":this.additionalProperties));
sb.append(',');
if (sb.charAt((sb.length()- 1)) == ',') {
sb.setCharAt((sb.length()- 1), ']');
} else {
sb.append(']');
}
return sb.toString();
}
@Override
public int hashCode() {
int result = 1;
result = ((result* 31)+((this.rect == null)? 0 :this.rect.hashCode()));
result = ((result* 31)+((this.cells == null)? 0 :this.cells.hashCode()));
result = ((result* 31)+((this.confidence == null)? 0 :this.confidence.hashCode()));
result = ((result* 31)+((this.columnSeparators == null)? 0 :this.columnSeparators.hashCode()));
result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode()));
result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode()));
result = ((result* 31)+((this.rowSeparators == null)? 0 :this.rowSeparators.hashCode()));
result = ((result* 31)+((this.kids == null)? 0 :this.kids.hashCode()));
return result;
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof Element) == false) {
return false;
}
Element rhs = ((Element) other);
return (((((((((this.rect == rhs.rect)||((this.rect!= null)&&this.rect.equals(rhs.rect)))&&((this.cells == rhs.cells)||((this.cells!= null)&&this.cells.equals(rhs.cells))))&&((this.confidence == rhs.confidence)||((this.confidence!= null)&&this.confidence.equals(rhs.confidence))))&&((this.columnSeparators == rhs.columnSeparators)||((this.columnSeparators!= null)&&this.columnSeparators.equals(rhs.columnSeparators))))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.rowSeparators == rhs.rowSeparators)||((this.rowSeparators!= null)&&this.rowSeparators.equals(rhs.rowSeparators))))&&((this.kids == rhs.kids)||((this.kids!= null)&&this.kids.equals(rhs.kids))));
}
}

View File

@ -0,0 +1,213 @@
package com.iqser.red.service.redaction.v1.server.apryse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.processing.Generated;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"type",
"rect",
"quad",
"text",
"style",
"kids"
})
@Generated("jsonschema2pojo")
public class Kid {
@JsonProperty("type")
private String type;
@JsonProperty("rect")
private List<Double> rect = new ArrayList<Double>();
@JsonProperty("quad")
private List<Double> quad = new ArrayList<Double>();
@JsonProperty("text")
private String text;
@JsonProperty("style")
private Style style;
@JsonProperty("kids")
private List<Kid__1> kids = new ArrayList<Kid__1>();
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
@JsonProperty("type")
public String getType() {
return type;
}
@JsonProperty("type")
public void setType(String type) {
this.type = type;
}
public Kid withType(String type) {
this.type = type;
return this;
}
@JsonProperty("rect")
public List<Double> getRect() {
return rect;
}
@JsonProperty("rect")
public void setRect(List<Double> rect) {
this.rect = rect;
}
public Kid withRect(List<Double> rect) {
this.rect = rect;
return this;
}
@JsonProperty("quad")
public List<Double> getQuad() {
return quad;
}
@JsonProperty("quad")
public void setQuad(List<Double> quad) {
this.quad = quad;
}
public Kid withQuad(List<Double> quad) {
this.quad = quad;
return this;
}
@JsonProperty("text")
public String getText() {
return text;
}
@JsonProperty("text")
public void setText(String text) {
this.text = text;
}
public Kid withText(String text) {
this.text = text;
return this;
}
@JsonProperty("style")
public Style getStyle() {
return style;
}
@JsonProperty("style")
public void setStyle(Style style) {
this.style = style;
}
public Kid withStyle(Style style) {
this.style = style;
return this;
}
@JsonProperty("kids")
public List<Kid__1> getKids() {
return kids;
}
@JsonProperty("kids")
public void setKids(List<Kid__1> kids) {
this.kids = kids;
}
public Kid withKids(List<Kid__1> kids) {
this.kids = kids;
return this;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
public Kid withAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(Kid.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
sb.append("type");
sb.append('=');
sb.append(((this.type == null)?"<null>":this.type));
sb.append(',');
sb.append("rect");
sb.append('=');
sb.append(((this.rect == null)?"<null>":this.rect));
sb.append(',');
sb.append("quad");
sb.append('=');
sb.append(((this.quad == null)?"<null>":this.quad));
sb.append(',');
sb.append("text");
sb.append('=');
sb.append(((this.text == null)?"<null>":this.text));
sb.append(',');
sb.append("style");
sb.append('=');
sb.append(((this.style == null)?"<null>":this.style));
sb.append(',');
sb.append("kids");
sb.append('=');
sb.append(((this.kids == null)?"<null>":this.kids));
sb.append(',');
sb.append("additionalProperties");
sb.append('=');
sb.append(((this.additionalProperties == null)?"<null>":this.additionalProperties));
sb.append(',');
if (sb.charAt((sb.length()- 1)) == ',') {
sb.setCharAt((sb.length()- 1), ']');
} else {
sb.append(']');
}
return sb.toString();
}
@Override
public int hashCode() {
int result = 1;
result = ((result* 31)+((this.rect == null)? 0 :this.rect.hashCode()));
result = ((result* 31)+((this.quad == null)? 0 :this.quad.hashCode()));
result = ((result* 31)+((this.style == null)? 0 :this.style.hashCode()));
result = ((result* 31)+((this.text == null)? 0 :this.text.hashCode()));
result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode()));
result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode()));
result = ((result* 31)+((this.kids == null)? 0 :this.kids.hashCode()));
return result;
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof Kid) == false) {
return false;
}
Kid rhs = ((Kid) other);
return ((((((((this.rect == rhs.rect)||((this.rect!= null)&&this.rect.equals(rhs.rect)))&&((this.quad == rhs.quad)||((this.quad!= null)&&this.quad.equals(rhs.quad))))&&((this.style == rhs.style)||((this.style!= null)&&this.style.equals(rhs.style))))&&((this.text == rhs.text)||((this.text!= null)&&this.text.equals(rhs.text))))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.kids == rhs.kids)||((this.kids!= null)&&this.kids.equals(rhs.kids))));
}
}

View File

@ -0,0 +1,167 @@
package com.iqser.red.service.redaction.v1.server.apryse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.processing.Generated;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"type",
"rect",
"quad",
"text"
})
@Generated("jsonschema2pojo")
public class Kid__1 {
@JsonProperty("type")
private String type;
@JsonProperty("rect")
private List<Double> rect = new ArrayList<Double>();
@JsonProperty("quad")
private List<Double> quad = new ArrayList<Double>();
@JsonProperty("text")
private String text;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
@JsonProperty("type")
public String getType() {
return type;
}
@JsonProperty("type")
public void setType(String type) {
this.type = type;
}
public Kid__1 withType(String type) {
this.type = type;
return this;
}
@JsonProperty("rect")
public List<Double> getRect() {
return rect;
}
@JsonProperty("rect")
public void setRect(List<Double> rect) {
this.rect = rect;
}
public Kid__1 withRect(List<Double> rect) {
this.rect = rect;
return this;
}
@JsonProperty("quad")
public List<Double> getQuad() {
return quad;
}
@JsonProperty("quad")
public void setQuad(List<Double> quad) {
this.quad = quad;
}
public Kid__1 withQuad(List<Double> quad) {
this.quad = quad;
return this;
}
@JsonProperty("text")
public String getText() {
return text;
}
@JsonProperty("text")
public void setText(String text) {
this.text = text;
}
public Kid__1 withText(String text) {
this.text = text;
return this;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
public Kid__1 withAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(Kid__1 .class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
sb.append("type");
sb.append('=');
sb.append(((this.type == null)?"<null>":this.type));
sb.append(',');
sb.append("rect");
sb.append('=');
sb.append(((this.rect == null)?"<null>":this.rect));
sb.append(',');
sb.append("quad");
sb.append('=');
sb.append(((this.quad == null)?"<null>":this.quad));
sb.append(',');
sb.append("text");
sb.append('=');
sb.append(((this.text == null)?"<null>":this.text));
sb.append(',');
sb.append("additionalProperties");
sb.append('=');
sb.append(((this.additionalProperties == null)?"<null>":this.additionalProperties));
sb.append(',');
if (sb.charAt((sb.length()- 1)) == ',') {
sb.setCharAt((sb.length()- 1), ']');
} else {
sb.append(']');
}
return sb.toString();
}
@Override
public int hashCode() {
int result = 1;
result = ((result* 31)+((this.rect == null)? 0 :this.rect.hashCode()));
result = ((result* 31)+((this.quad == null)? 0 :this.quad.hashCode()));
result = ((result* 31)+((this.text == null)? 0 :this.text.hashCode()));
result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode()));
result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode()));
return result;
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof Kid__1) == false) {
return false;
}
Kid__1 rhs = ((Kid__1) other);
return ((((((this.rect == rhs.rect)||((this.rect!= null)&&this.rect.equals(rhs.rect)))&&((this.quad == rhs.quad)||((this.quad!= null)&&this.quad.equals(rhs.quad))))&&((this.text == rhs.text)||((this.text!= null)&&this.text.equals(rhs.text))))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))));
}
}

View File

@ -0,0 +1,121 @@
package com.iqser.red.service.redaction.v1.server.apryse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.processing.Generated;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"type",
"kids"
})
@Generated("jsonschema2pojo")
public class Kid__2 {
@JsonProperty("type")
private String type;
@JsonProperty("kids")
private List<Kid__3> kids = new ArrayList<Kid__3>();
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
@JsonProperty("type")
public String getType() {
return type;
}
@JsonProperty("type")
public void setType(String type) {
this.type = type;
}
public Kid__2 withType(String type) {
this.type = type;
return this;
}
@JsonProperty("kids")
public List<Kid__3> getKids() {
return kids;
}
@JsonProperty("kids")
public void setKids(List<Kid__3> kids) {
this.kids = kids;
}
public Kid__2 withKids(List<Kid__3> kids) {
this.kids = kids;
return this;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
public Kid__2 withAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(Kid__2 .class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
sb.append("type");
sb.append('=');
sb.append(((this.type == null)?"<null>":this.type));
sb.append(',');
sb.append("kids");
sb.append('=');
sb.append(((this.kids == null)?"<null>":this.kids));
sb.append(',');
sb.append("additionalProperties");
sb.append('=');
sb.append(((this.additionalProperties == null)?"<null>":this.additionalProperties));
sb.append(',');
if (sb.charAt((sb.length()- 1)) == ',') {
sb.setCharAt((sb.length()- 1), ']');
} else {
sb.append(']');
}
return sb.toString();
}
@Override
public int hashCode() {
int result = 1;
result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode()));
result = ((result* 31)+((this.kids == null)? 0 :this.kids.hashCode()));
result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode()));
return result;
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof Kid__2) == false) {
return false;
}
Kid__2 rhs = ((Kid__2) other);
return ((((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type)))&&((this.kids == rhs.kids)||((this.kids!= null)&&this.kids.equals(rhs.kids))))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))));
}
}

View File

@ -0,0 +1,213 @@
package com.iqser.red.service.redaction.v1.server.apryse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.processing.Generated;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"type",
"rect",
"quad",
"text",
"style",
"kids"
})
@Generated("jsonschema2pojo")
public class Kid__3 {
@JsonProperty("type")
private String type;
@JsonProperty("rect")
private List<Double> rect = new ArrayList<Double>();
@JsonProperty("quad")
private List<Double> quad = new ArrayList<Double>();
@JsonProperty("text")
private String text;
@JsonProperty("style")
private Style__1 style;
@JsonProperty("kids")
private List<Kid__4> kids = new ArrayList<Kid__4>();
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
@JsonProperty("type")
public String getType() {
return type;
}
@JsonProperty("type")
public void setType(String type) {
this.type = type;
}
public Kid__3 withType(String type) {
this.type = type;
return this;
}
@JsonProperty("rect")
public List<Double> getRect() {
return rect;
}
@JsonProperty("rect")
public void setRect(List<Double> rect) {
this.rect = rect;
}
public Kid__3 withRect(List<Double> rect) {
this.rect = rect;
return this;
}
@JsonProperty("quad")
public List<Double> getQuad() {
return quad;
}
@JsonProperty("quad")
public void setQuad(List<Double> quad) {
this.quad = quad;
}
public Kid__3 withQuad(List<Double> quad) {
this.quad = quad;
return this;
}
@JsonProperty("text")
public String getText() {
return text;
}
@JsonProperty("text")
public void setText(String text) {
this.text = text;
}
public Kid__3 withText(String text) {
this.text = text;
return this;
}
@JsonProperty("style")
public Style__1 getStyle() {
return style;
}
@JsonProperty("style")
public void setStyle(Style__1 style) {
this.style = style;
}
public Kid__3 withStyle(Style__1 style) {
this.style = style;
return this;
}
@JsonProperty("kids")
public List<Kid__4> getKids() {
return kids;
}
@JsonProperty("kids")
public void setKids(List<Kid__4> kids) {
this.kids = kids;
}
public Kid__3 withKids(List<Kid__4> kids) {
this.kids = kids;
return this;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
public Kid__3 withAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(Kid__3 .class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
sb.append("type");
sb.append('=');
sb.append(((this.type == null)?"<null>":this.type));
sb.append(',');
sb.append("rect");
sb.append('=');
sb.append(((this.rect == null)?"<null>":this.rect));
sb.append(',');
sb.append("quad");
sb.append('=');
sb.append(((this.quad == null)?"<null>":this.quad));
sb.append(',');
sb.append("text");
sb.append('=');
sb.append(((this.text == null)?"<null>":this.text));
sb.append(',');
sb.append("style");
sb.append('=');
sb.append(((this.style == null)?"<null>":this.style));
sb.append(',');
sb.append("kids");
sb.append('=');
sb.append(((this.kids == null)?"<null>":this.kids));
sb.append(',');
sb.append("additionalProperties");
sb.append('=');
sb.append(((this.additionalProperties == null)?"<null>":this.additionalProperties));
sb.append(',');
if (sb.charAt((sb.length()- 1)) == ',') {
sb.setCharAt((sb.length()- 1), ']');
} else {
sb.append(']');
}
return sb.toString();
}
@Override
public int hashCode() {
int result = 1;
result = ((result* 31)+((this.rect == null)? 0 :this.rect.hashCode()));
result = ((result* 31)+((this.quad == null)? 0 :this.quad.hashCode()));
result = ((result* 31)+((this.style == null)? 0 :this.style.hashCode()));
result = ((result* 31)+((this.text == null)? 0 :this.text.hashCode()));
result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode()));
result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode()));
result = ((result* 31)+((this.kids == null)? 0 :this.kids.hashCode()));
return result;
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof Kid__3) == false) {
return false;
}
Kid__3 rhs = ((Kid__3) other);
return ((((((((this.rect == rhs.rect)||((this.rect!= null)&&this.rect.equals(rhs.rect)))&&((this.quad == rhs.quad)||((this.quad!= null)&&this.quad.equals(rhs.quad))))&&((this.style == rhs.style)||((this.style!= null)&&this.style.equals(rhs.style))))&&((this.text == rhs.text)||((this.text!= null)&&this.text.equals(rhs.text))))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.kids == rhs.kids)||((this.kids!= null)&&this.kids.equals(rhs.kids))));
}
}

View File

@ -0,0 +1,167 @@
package com.iqser.red.service.redaction.v1.server.apryse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.processing.Generated;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"type",
"rect",
"quad",
"text"
})
@Generated("jsonschema2pojo")
public class Kid__4 {
@JsonProperty("type")
private String type;
@JsonProperty("rect")
private List<Double> rect = new ArrayList<Double>();
@JsonProperty("quad")
private List<Double> quad = new ArrayList<Double>();
@JsonProperty("text")
private String text;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
@JsonProperty("type")
public String getType() {
return type;
}
@JsonProperty("type")
public void setType(String type) {
this.type = type;
}
public Kid__4 withType(String type) {
this.type = type;
return this;
}
@JsonProperty("rect")
public List<Double> getRect() {
return rect;
}
@JsonProperty("rect")
public void setRect(List<Double> rect) {
this.rect = rect;
}
public Kid__4 withRect(List<Double> rect) {
this.rect = rect;
return this;
}
@JsonProperty("quad")
public List<Double> getQuad() {
return quad;
}
@JsonProperty("quad")
public void setQuad(List<Double> quad) {
this.quad = quad;
}
public Kid__4 withQuad(List<Double> quad) {
this.quad = quad;
return this;
}
@JsonProperty("text")
public String getText() {
return text;
}
@JsonProperty("text")
public void setText(String text) {
this.text = text;
}
public Kid__4 withText(String text) {
this.text = text;
return this;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
public Kid__4 withAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(Kid__4 .class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
sb.append("type");
sb.append('=');
sb.append(((this.type == null)?"<null>":this.type));
sb.append(',');
sb.append("rect");
sb.append('=');
sb.append(((this.rect == null)?"<null>":this.rect));
sb.append(',');
sb.append("quad");
sb.append('=');
sb.append(((this.quad == null)?"<null>":this.quad));
sb.append(',');
sb.append("text");
sb.append('=');
sb.append(((this.text == null)?"<null>":this.text));
sb.append(',');
sb.append("additionalProperties");
sb.append('=');
sb.append(((this.additionalProperties == null)?"<null>":this.additionalProperties));
sb.append(',');
if (sb.charAt((sb.length()- 1)) == ',') {
sb.setCharAt((sb.length()- 1), ']');
} else {
sb.append(']');
}
return sb.toString();
}
@Override
public int hashCode() {
int result = 1;
result = ((result* 31)+((this.rect == null)? 0 :this.rect.hashCode()));
result = ((result* 31)+((this.quad == null)? 0 :this.quad.hashCode()));
result = ((result* 31)+((this.text == null)? 0 :this.text.hashCode()));
result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode()));
result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode()));
return result;
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof Kid__4) == false) {
return false;
}
Kid__4 rhs = ((Kid__4) other);
return ((((((this.rect == rhs.rect)||((this.rect!= null)&&this.rect.equals(rhs.rect)))&&((this.quad == rhs.quad)||((this.quad!= null)&&this.quad.equals(rhs.quad))))&&((this.text == rhs.text)||((this.text!= null)&&this.text.equals(rhs.text))))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))));
}
}

View File

@ -0,0 +1,121 @@
package com.iqser.red.service.redaction.v1.server.apryse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.processing.Generated;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"properties",
"elements"
})
@Generated("jsonschema2pojo")
public class Page {
@JsonProperty("properties")
private Properties properties;
@JsonProperty("elements")
private List<Element> elements = new ArrayList<Element>();
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
@JsonProperty("properties")
public Properties getProperties() {
return properties;
}
@JsonProperty("properties")
public void setProperties(Properties properties) {
this.properties = properties;
}
public Page withProperties(Properties properties) {
this.properties = properties;
return this;
}
@JsonProperty("elements")
public List<Element> getElements() {
return elements;
}
@JsonProperty("elements")
public void setElements(List<Element> elements) {
this.elements = elements;
}
public Page withElements(List<Element> elements) {
this.elements = elements;
return this;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
public Page withAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(Page.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
sb.append("properties");
sb.append('=');
sb.append(((this.properties == null)?"<null>":this.properties));
sb.append(',');
sb.append("elements");
sb.append('=');
sb.append(((this.elements == null)?"<null>":this.elements));
sb.append(',');
sb.append("additionalProperties");
sb.append('=');
sb.append(((this.additionalProperties == null)?"<null>":this.additionalProperties));
sb.append(',');
if (sb.charAt((sb.length()- 1)) == ',') {
sb.setCharAt((sb.length()- 1), ']');
} else {
sb.append(']');
}
return sb.toString();
}
@Override
public int hashCode() {
int result = 1;
result = ((result* 31)+((this.properties == null)? 0 :this.properties.hashCode()));
result = ((result* 31)+((this.elements == null)? 0 :this.elements.hashCode()));
result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode()));
return result;
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof Page) == false) {
return false;
}
Page rhs = ((Page) other);
return ((((this.properties == rhs.properties)||((this.properties!= null)&&this.properties.equals(rhs.properties)))&&((this.elements == rhs.elements)||((this.elements!= null)&&this.elements.equals(rhs.elements))))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))));
}
}

View File

@ -0,0 +1,190 @@
package com.iqser.red.service.redaction.v1.server.apryse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.processing.Generated;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"pageNumber",
"cropBox",
"mediaBox",
"rotation",
"langCode"
})
@Generated("jsonschema2pojo")
public class Properties {
@JsonProperty("pageNumber")
private Integer pageNumber;
@JsonProperty("cropBox")
private List<Double> cropBox = new ArrayList<Double>();
@JsonProperty("mediaBox")
private List<Double> mediaBox = new ArrayList<Double>();
@JsonProperty("rotation")
private Integer rotation;
@JsonProperty("langCode")
private String langCode;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
@JsonProperty("pageNumber")
public Integer getPageNumber() {
return pageNumber;
}
@JsonProperty("pageNumber")
public void setPageNumber(Integer pageNumber) {
this.pageNumber = pageNumber;
}
public Properties withPageNumber(Integer pageNumber) {
this.pageNumber = pageNumber;
return this;
}
@JsonProperty("cropBox")
public List<Double> getCropBox() {
return cropBox;
}
@JsonProperty("cropBox")
public void setCropBox(List<Double> cropBox) {
this.cropBox = cropBox;
}
public Properties withCropBox(List<Double> cropBox) {
this.cropBox = cropBox;
return this;
}
@JsonProperty("mediaBox")
public List<Double> getMediaBox() {
return mediaBox;
}
@JsonProperty("mediaBox")
public void setMediaBox(List<Double> mediaBox) {
this.mediaBox = mediaBox;
}
public Properties withMediaBox(List<Double> mediaBox) {
this.mediaBox = mediaBox;
return this;
}
@JsonProperty("rotation")
public Integer getRotation() {
return rotation;
}
@JsonProperty("rotation")
public void setRotation(Integer rotation) {
this.rotation = rotation;
}
public Properties withRotation(Integer rotation) {
this.rotation = rotation;
return this;
}
@JsonProperty("langCode")
public String getLangCode() {
return langCode;
}
@JsonProperty("langCode")
public void setLangCode(String langCode) {
this.langCode = langCode;
}
public Properties withLangCode(String langCode) {
this.langCode = langCode;
return this;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
public Properties withAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(Properties.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
sb.append("pageNumber");
sb.append('=');
sb.append(((this.pageNumber == null)?"<null>":this.pageNumber));
sb.append(',');
sb.append("cropBox");
sb.append('=');
sb.append(((this.cropBox == null)?"<null>":this.cropBox));
sb.append(',');
sb.append("mediaBox");
sb.append('=');
sb.append(((this.mediaBox == null)?"<null>":this.mediaBox));
sb.append(',');
sb.append("rotation");
sb.append('=');
sb.append(((this.rotation == null)?"<null>":this.rotation));
sb.append(',');
sb.append("langCode");
sb.append('=');
sb.append(((this.langCode == null)?"<null>":this.langCode));
sb.append(',');
sb.append("additionalProperties");
sb.append('=');
sb.append(((this.additionalProperties == null)?"<null>":this.additionalProperties));
sb.append(',');
if (sb.charAt((sb.length()- 1)) == ',') {
sb.setCharAt((sb.length()- 1), ']');
} else {
sb.append(']');
}
return sb.toString();
}
@Override
public int hashCode() {
int result = 1;
result = ((result* 31)+((this.mediaBox == null)? 0 :this.mediaBox.hashCode()));
result = ((result* 31)+((this.cropBox == null)? 0 :this.cropBox.hashCode()));
result = ((result* 31)+((this.pageNumber == null)? 0 :this.pageNumber.hashCode()));
result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode()));
result = ((result* 31)+((this.rotation == null)? 0 :this.rotation.hashCode()));
result = ((result* 31)+((this.langCode == null)? 0 :this.langCode.hashCode()));
return result;
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof Properties) == false) {
return false;
}
Properties rhs = ((Properties) other);
return (((((((this.mediaBox == rhs.mediaBox)||((this.mediaBox!= null)&&this.mediaBox.equals(rhs.mediaBox)))&&((this.cropBox == rhs.cropBox)||((this.cropBox!= null)&&this.cropBox.equals(rhs.cropBox))))&&((this.pageNumber == rhs.pageNumber)||((this.pageNumber!= null)&&this.pageNumber.equals(rhs.pageNumber))))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))))&&((this.rotation == rhs.rotation)||((this.rotation!= null)&&this.rotation.equals(rhs.rotation))))&&((this.langCode == rhs.langCode)||((this.langCode!= null)&&this.langCode.equals(rhs.langCode))));
}
}

View File

@ -0,0 +1,211 @@
package com.iqser.red.service.redaction.v1.server.apryse;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.processing.Generated;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"color",
"name",
"size",
"weight",
"italic",
"serif"
})
@Generated("jsonschema2pojo")
public class Style {
@JsonProperty("color")
private String color;
@JsonProperty("name")
private String name;
@JsonProperty("size")
private Double size;
@JsonProperty("weight")
private Double weight;
@JsonProperty("italic")
private Boolean italic;
@JsonProperty("serif")
private Boolean serif;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
@JsonProperty("color")
public String getColor() {
return color;
}
@JsonProperty("color")
public void setColor(String color) {
this.color = color;
}
public Style withColor(String color) {
this.color = color;
return this;
}
@JsonProperty("name")
public String getName() {
return name;
}
@JsonProperty("name")
public void setName(String name) {
this.name = name;
}
public Style withName(String name) {
this.name = name;
return this;
}
@JsonProperty("size")
public Double getSize() {
return size;
}
@JsonProperty("size")
public void setSize(Double size) {
this.size = size;
}
public Style withSize(Double size) {
this.size = size;
return this;
}
@JsonProperty("weight")
public Double getWeight() {
return weight;
}
@JsonProperty("weight")
public void setWeight(Double weight) {
this.weight = weight;
}
public Style withWeight(Double weight) {
this.weight = weight;
return this;
}
@JsonProperty("italic")
public Boolean getItalic() {
return italic;
}
@JsonProperty("italic")
public void setItalic(Boolean italic) {
this.italic = italic;
}
public Style withItalic(Boolean italic) {
this.italic = italic;
return this;
}
@JsonProperty("serif")
public Boolean getSerif() {
return serif;
}
@JsonProperty("serif")
public void setSerif(Boolean serif) {
this.serif = serif;
}
public Style withSerif(Boolean serif) {
this.serif = serif;
return this;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
public Style withAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(Style.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
sb.append("color");
sb.append('=');
sb.append(((this.color == null)?"<null>":this.color));
sb.append(',');
sb.append("name");
sb.append('=');
sb.append(((this.name == null)?"<null>":this.name));
sb.append(',');
sb.append("size");
sb.append('=');
sb.append(((this.size == null)?"<null>":this.size));
sb.append(',');
sb.append("weight");
sb.append('=');
sb.append(((this.weight == null)?"<null>":this.weight));
sb.append(',');
sb.append("italic");
sb.append('=');
sb.append(((this.italic == null)?"<null>":this.italic));
sb.append(',');
sb.append("serif");
sb.append('=');
sb.append(((this.serif == null)?"<null>":this.serif));
sb.append(',');
sb.append("additionalProperties");
sb.append('=');
sb.append(((this.additionalProperties == null)?"<null>":this.additionalProperties));
sb.append(',');
if (sb.charAt((sb.length()- 1)) == ',') {
sb.setCharAt((sb.length()- 1), ']');
} else {
sb.append(']');
}
return sb.toString();
}
@Override
public int hashCode() {
int result = 1;
result = ((result* 31)+((this.color == null)? 0 :this.color.hashCode()));
result = ((result* 31)+((this.size == null)? 0 :this.size.hashCode()));
result = ((result* 31)+((this.name == null)? 0 :this.name.hashCode()));
result = ((result* 31)+((this.weight == null)? 0 :this.weight.hashCode()));
result = ((result* 31)+((this.serif == null)? 0 :this.serif.hashCode()));
result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode()));
result = ((result* 31)+((this.italic == null)? 0 :this.italic.hashCode()));
return result;
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof Style) == false) {
return false;
}
Style rhs = ((Style) other);
return ((((((((this.color == rhs.color)||((this.color!= null)&&this.color.equals(rhs.color)))&&((this.size == rhs.size)||((this.size!= null)&&this.size.equals(rhs.size))))&&((this.name == rhs.name)||((this.name!= null)&&this.name.equals(rhs.name))))&&((this.weight == rhs.weight)||((this.weight!= null)&&this.weight.equals(rhs.weight))))&&((this.serif == rhs.serif)||((this.serif!= null)&&this.serif.equals(rhs.serif))))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))))&&((this.italic == rhs.italic)||((this.italic!= null)&&this.italic.equals(rhs.italic))));
}
}

View File

@ -0,0 +1,211 @@
package com.iqser.red.service.redaction.v1.server.apryse;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.processing.Generated;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"color",
"name",
"size",
"weight",
"italic",
"serif"
})
@Generated("jsonschema2pojo")
public class Style__1 {
@JsonProperty("color")
private String color;
@JsonProperty("name")
private String name;
@JsonProperty("size")
private Double size;
@JsonProperty("weight")
private Double weight;
@JsonProperty("italic")
private Boolean italic;
@JsonProperty("serif")
private Boolean serif;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
@JsonProperty("color")
public String getColor() {
return color;
}
@JsonProperty("color")
public void setColor(String color) {
this.color = color;
}
public Style__1 withColor(String color) {
this.color = color;
return this;
}
@JsonProperty("name")
public String getName() {
return name;
}
@JsonProperty("name")
public void setName(String name) {
this.name = name;
}
public Style__1 withName(String name) {
this.name = name;
return this;
}
@JsonProperty("size")
public Double getSize() {
return size;
}
@JsonProperty("size")
public void setSize(Double size) {
this.size = size;
}
public Style__1 withSize(Double size) {
this.size = size;
return this;
}
@JsonProperty("weight")
public Double getWeight() {
return weight;
}
@JsonProperty("weight")
public void setWeight(Double weight) {
this.weight = weight;
}
public Style__1 withWeight(Double weight) {
this.weight = weight;
return this;
}
@JsonProperty("italic")
public Boolean getItalic() {
return italic;
}
@JsonProperty("italic")
public void setItalic(Boolean italic) {
this.italic = italic;
}
public Style__1 withItalic(Boolean italic) {
this.italic = italic;
return this;
}
@JsonProperty("serif")
public Boolean getSerif() {
return serif;
}
@JsonProperty("serif")
public void setSerif(Boolean serif) {
this.serif = serif;
}
public Style__1 withSerif(Boolean serif) {
this.serif = serif;
return this;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
public Style__1 withAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(Style__1 .class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
sb.append("color");
sb.append('=');
sb.append(((this.color == null)?"<null>":this.color));
sb.append(',');
sb.append("name");
sb.append('=');
sb.append(((this.name == null)?"<null>":this.name));
sb.append(',');
sb.append("size");
sb.append('=');
sb.append(((this.size == null)?"<null>":this.size));
sb.append(',');
sb.append("weight");
sb.append('=');
sb.append(((this.weight == null)?"<null>":this.weight));
sb.append(',');
sb.append("italic");
sb.append('=');
sb.append(((this.italic == null)?"<null>":this.italic));
sb.append(',');
sb.append("serif");
sb.append('=');
sb.append(((this.serif == null)?"<null>":this.serif));
sb.append(',');
sb.append("additionalProperties");
sb.append('=');
sb.append(((this.additionalProperties == null)?"<null>":this.additionalProperties));
sb.append(',');
if (sb.charAt((sb.length()- 1)) == ',') {
sb.setCharAt((sb.length()- 1), ']');
} else {
sb.append(']');
}
return sb.toString();
}
@Override
public int hashCode() {
int result = 1;
result = ((result* 31)+((this.color == null)? 0 :this.color.hashCode()));
result = ((result* 31)+((this.size == null)? 0 :this.size.hashCode()));
result = ((result* 31)+((this.name == null)? 0 :this.name.hashCode()));
result = ((result* 31)+((this.weight == null)? 0 :this.weight.hashCode()));
result = ((result* 31)+((this.serif == null)? 0 :this.serif.hashCode()));
result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode()));
result = ((result* 31)+((this.italic == null)? 0 :this.italic.hashCode()));
return result;
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof Style__1) == false) {
return false;
}
Style__1 rhs = ((Style__1) other);
return ((((((((this.color == rhs.color)||((this.color!= null)&&this.color.equals(rhs.color)))&&((this.size == rhs.size)||((this.size!= null)&&this.size.equals(rhs.size))))&&((this.name == rhs.name)||((this.name!= null)&&this.name.equals(rhs.name))))&&((this.weight == rhs.weight)||((this.weight!= null)&&this.weight.equals(rhs.weight))))&&((this.serif == rhs.serif)||((this.serif!= null)&&this.serif.equals(rhs.serif))))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))))&&((this.italic == rhs.italic)||((this.italic!= null)&&this.italic.equals(rhs.italic))));
}
}

View File

@ -0,0 +1,261 @@
package com.iqser.red.service.redaction.v1.server;
import static org.mockito.Mockito.when;
import java.awt.Color;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URL;
import java.security.KeyManagementException;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.util.List;
import java.util.UUID;
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipFile;
import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
import org.apache.hc.client5.http.impl.classic.HttpClients;
import org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManagerBuilder;
import org.apache.hc.client5.http.ssl.NoopHostnameVerifier;
import org.apache.hc.client5.http.ssl.SSLConnectionSocketFactoryBuilder;
import org.apache.hc.client5.http.ssl.TrustAllStrategy;
import org.apache.hc.core5.ssl.SSLContextBuilder;
import org.apache.pdfbox.io.MemoryUsageSetting;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.PDPageContentStream;
import org.jsonschema2pojo.DefaultGenerationConfig;
import org.jsonschema2pojo.GenerationConfig;
import org.jsonschema2pojo.Jackson2Annotator;
import org.jsonschema2pojo.SchemaGenerator;
import org.jsonschema2pojo.SchemaMapper;
import org.jsonschema2pojo.SchemaStore;
import org.jsonschema2pojo.SourceType;
import org.jsonschema2pojo.rules.RuleFactory;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.Primary;
import org.springframework.core.io.ClassPathResource;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.web.client.RestTemplate;
import com.iqser.red.service.persistence.service.v1.api.shared.model.common.JSONPrimitive;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.type.Type;
import com.iqser.red.service.redaction.v1.server.apryse.ApryseAiResponse;
import com.iqser.red.service.redaction.v1.server.layoutparsing.classification.utils.FileUtils;
import com.iqser.red.storage.commons.StorageAutoConfiguration;
import com.iqser.red.storage.commons.service.StorageService;
import com.knecon.fforesight.tenantcommons.TenantContext;
import com.sun.codemodel.JCodeModel;
import lombok.SneakyThrows;
@ExtendWith(SpringExtension.class)
@SpringBootTest(classes = Application.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = {"application.type=DocuMine"})
@Import(ApryseAiTest.RedactionIntegrationTestConfiguration.class)
public class ApryseAiTest extends AbstractRedactionIntegrationTest {
private static final String RULES = loadFromClassPath("drools/documine_flora.drl");
private static final String APRYSE_URL = "https://ai-serve.pdftron.com/recog/predict";
@Autowired
private RestTemplate restTemplate;
@Test
@SneakyThrows
@Disabled
public void testApryseEndpoint() {
ClassPathResource inputPdf = new ClassPathResource("files/apryseAi/Input.pdf");
String outFile = "/tmp/Output.pdf";
byte[] inputAsBytes = inputPdf.getContentAsByteArray();
String filename = UUID.randomUUID().toString();
HttpHeaders headers = new HttpHeaders();
headers.add("Output-JSON", "true");
headers.add("File-Name", filename);
headers.add("Force-OCR", "true");
HttpEntity<byte[]> httpEntity = new HttpEntity<>(inputAsBytes, headers);
byte[] result = restTemplate.postForObject(APRYSE_URL, httpEntity, byte[].class);
File responseFile = FileUtils.createTempFile(filename, "zip");
try (FileOutputStream outputStream = new FileOutputStream(responseFile)) {
outputStream.write(result);
}
ZipFile zipFile = new ZipFile(responseFile);
ZipArchiveEntry zipEntry = zipFile.getEntry(filename + ".json");
byte[] jsonResponse = readCurrentZipEntry(zipEntry, zipFile);
zipFile.close();
ApryseAiResponse response = objectMapper.readValue(jsonResponse, ApryseAiResponse.class);
var pdDocument = PDDocument.load(inputPdf.getInputStream(), MemoryUsageSetting.setupMixed(67108864L));
pdDocument.setAllSecurityToBeRemoved(true);
response.getPages().forEach(page -> {
try (PDPageContentStream contentStream = new PDPageContentStream(pdDocument, pdDocument.getPage(page.getProperties().getPageNumber() - 1), PDPageContentStream.AppendMode.APPEND, true)){
contentStream.setStrokingColor(Color.BLUE);
contentStream.setLineWidth(1f);
var tables = page.getElements().stream().filter(e -> e.getType().equals("table")).toList();
tables.forEach(table -> {
table.getCells().forEach(cell -> {
try {
contentStream.addRect(cell.getRect().get(0).floatValue(),
cell.getRect().get(1).floatValue(),
cell.getRect().get(2).floatValue() - cell.getRect().get(0).floatValue(),
cell.getRect().get(3).floatValue() - cell.getRect().get(1).floatValue());
contentStream.stroke();
} catch (IOException e) {
throw new RuntimeException(e);
}
});
});
} catch (IOException e) {
throw new RuntimeException(e);
}
});
pdDocument.save(new File(outFile));
pdDocument.close();
}
private byte[] readCurrentZipEntry(ZipArchiveEntry ze, ZipFile zipFile) throws IOException {
var bos = new ByteArrayOutputStream();
try (var entryStream = zipFile.getInputStream(ze)) {
var buffer = new byte[2048];
var nBytes = 0;
while ((nBytes = entryStream.read(buffer)) > 0) {
bos.write(buffer, 0, nBytes);
}
}
return bos.toByteArray();
}
@Test
@Disabled
public void generateJavaPojos() throws IOException {
URL url = new URL("file:///tmp/Input.json");
File file = new File("/tmp/Output/");
convertJsonToJavaClass(url, file, "com.knecon.ai", "ApryseAiResponse");
}
public void convertJsonToJavaClass(URL inputJsonUrl, File outputJavaClassDirectory, String packageName, String javaClassName) throws IOException {
JCodeModel jcodeModel = new JCodeModel();
GenerationConfig config = new DefaultGenerationConfig() {
@Override
public boolean isGenerateBuilders() {
return true;
}
@Override
public SourceType getSourceType() {
return SourceType.JSON;
}
};
SchemaMapper mapper = new SchemaMapper(new RuleFactory(config, new Jackson2Annotator(config), new SchemaStore()), new SchemaGenerator());
mapper.generate(jcodeModel, javaClassName, packageName, inputJsonUrl);
jcodeModel.build(outputJavaClassDirectory);
}
@Configuration
@EnableAutoConfiguration(exclude = {RabbitAutoConfiguration.class})
@ComponentScan(excludeFilters = {@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = StorageAutoConfiguration.class)})
static class RedactionIntegrationTestConfiguration {
@Bean
public RestTemplate restTemplate() throws NoSuchAlgorithmException, KeyStoreException, KeyManagementException {
CloseableHttpClient httpClient = HttpClients.custom()
.setConnectionManager(PoolingHttpClientConnectionManagerBuilder.create()
.setSSLSocketFactory(SSLConnectionSocketFactoryBuilder.create()
.setSslContext(SSLContextBuilder.create().loadTrustMaterial(TrustAllStrategy.INSTANCE).build())
.setHostnameVerifier(NoopHostnameVerifier.INSTANCE)
.build())
.build())
.build();
HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory();
requestFactory.setHttpClient(httpClient);
requestFactory.setConnectTimeout(30000);
requestFactory.setConnectionRequestTimeout(30000);
return new RestTemplate(requestFactory);
}
@Bean
@Primary
public StorageService inmemoryStorage() {
return new FileSystemBackedStorageService();
}
}
@BeforeEach
public void stubClients() {
TenantContext.setTenantId("redaction");
when(rulesClient.getVersion(TEST_DOSSIER_TEMPLATE_ID)).thenReturn(0L);
when(rulesClient.getRules(TEST_DOSSIER_TEMPLATE_ID)).thenReturn(JSONPrimitive.of(RULES));
loadTypeForTest();
loadNerForTest();
when(dictionaryClient.getVersion(TEST_DOSSIER_TEMPLATE_ID)).thenReturn(0L);
when(dictionaryClient.getAllTypesForDossierTemplate(TEST_DOSSIER_TEMPLATE_ID, false)).thenReturn(getTypeResponse());
when(dictionaryClient.getVersion(TEST_DOSSIER_TEMPLATE_ID)).thenReturn(0L);
when(dictionaryClient.getAllTypesForDossier(TEST_DOSSIER_ID, false)).thenReturn(List.of(Type.builder()
.id(DOSSIER_REDACTIONS_INDICATOR + ":" + TEST_DOSSIER_TEMPLATE_ID)
.type(DOSSIER_REDACTIONS_INDICATOR)
.dossierTemplateId(TEST_DOSSIER_ID)
.hexColor("#ffe187")
.isHint(hintTypeMap.get(DOSSIER_REDACTIONS_INDICATOR))
.isCaseInsensitive(caseInSensitiveMap.get(DOSSIER_REDACTIONS_INDICATOR))
.isRecommendation(recommendationTypeMap.get(DOSSIER_REDACTIONS_INDICATOR))
.rank(rankTypeMap.get(DOSSIER_REDACTIONS_INDICATOR))
.build()));
mockDictionaryCalls(null);
when(dictionaryClient.getColors(TEST_DOSSIER_TEMPLATE_ID)).thenReturn(colors);
}
}