Skip to content

Commit a47b43a

Browse files
committed
♻️ update active options string output
1 parent c16c9e1 commit a47b43a

File tree

5 files changed

+26
-9
lines changed

5 files changed

+26
-9
lines changed

src/main/java/com/mindee/parsing/v2/DataSchemaActiveOptions.java

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,34 @@
44
import com.fasterxml.jackson.annotation.JsonProperty;
55
import lombok.EqualsAndHashCode;
66

7+
import java.util.StringJoiner;
8+
9+
import static com.mindee.parsing.SummaryHelper.formatForDisplay;
10+
711
/**
812
* Data schema options activated during the inference.
913
*/
1014
@EqualsAndHashCode
1115
@JsonIgnoreProperties(ignoreUnknown = true)
1216
public class DataSchemaActiveOptions {
1317

14-
@JsonProperty("override")
15-
private boolean override;
18+
@JsonProperty("replace")
19+
private boolean replace;
1620

1721
/**
18-
* Whether a data schema override was provided for the inference.
22+
* Whether the data schema was replaced for the inference.
1923
*/
20-
public boolean getOverride() {
21-
return override;
24+
public boolean getReplace() {
25+
return replace;
26+
}
27+
28+
@Override
29+
public String toString() {
30+
StringJoiner joiner = new StringJoiner("\n");
31+
return joiner
32+
.add("Data Schema")
33+
.add("-----------")
34+
.add(":Replace: " + formatForDisplay(replace, 5))
35+
.toString();
2236
}
2337
}

src/main/java/com/mindee/parsing/v2/InferenceActiveOptions.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import lombok.Getter;
1010

1111
/**
12-
* Option response for V2 API inference.
12+
* Options which were activated during the inference.
1313
*/
1414
@EqualsAndHashCode
1515
@JsonIgnoreProperties(ignoreUnknown = true)
@@ -80,6 +80,9 @@ public String toString() {
8080
.add(":Polygon: " + formatForDisplay(polygon, 5))
8181
.add(":Confidence: " + formatForDisplay(confidence, 5))
8282
.add(":RAG: " + formatForDisplay(rag, 5))
83+
.add(":Text Context: " + formatForDisplay(textContext, 5))
84+
.add("")
85+
.add(dataSchema.toString())
8386
.toString();
8487
}
8588
}

src/test/java/com/mindee/input/LocalResponseV2Test.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class LocalResponseV2Test {
2121
/**
2222
* Real signature using fake secret key.
2323
*/
24-
String signature = "b82a515c832fd2c4f4ce3a7e6f53c12e8d10e19223f6cf0e3a9809a7a3da26be";
24+
String signature = "1df388c992d87897fe61dfc56c444c58fc3c7369c31e2b5fd20d867695e93e85";
2525

2626
/**
2727
* File which the signature applies to.

src/test/java/com/mindee/parsing/v2/InferenceTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ void rawTexts_mustBeAccessible() throws IOException {
472472
assertFalse(activeOptions.getPolygon());
473473
assertFalse(activeOptions.getConfidence());
474474
assertFalse(activeOptions.getTextContext());
475-
assertFalse(activeOptions.getDataSchema().getOverride());
475+
assertFalse(activeOptions.getDataSchema().getReplace());
476476

477477
assertNull(inference.getResult().getRag());
478478

0 commit comments

Comments
 (0)