Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
153 commits
Select commit Hold shift + click to select a range
be4d761
Configurations: 'specification/ai/ContentUnderstanding/tspconfig.yam…
azure-sdk Dec 3, 2025
876170a
Merge remote-tracking branch 'origin/main' into sdkauto/azure-ai-cont…
yungshinlintw Dec 4, 2025
c8df6ad
SDK-GEN: Re-generate SDK based on commmit e11e268a65224bd90f3aa450d44…
yungshinlintw Dec 4, 2025
72993cc
Add sample tests for configuring defaults and analyzing binary docume…
Dec 4, 2025
e34b5f8
[ContentUnderstanding] Add Java samples (Sample00-Sample04) converted…
Dec 5, 2025
a9bd363
[ContentUnderstanding] Add Sample05 and Sample06
Dec 5, 2025
2d284fb
[ContentUnderstanding] Add Sample07 and Sample08
Dec 5, 2025
d180a18
[ContentUnderstanding] Fix Sample08 update conflict issue
Dec 5, 2025
3495c1f
[ContentUnderstanding] Add Sample09_DeleteAnalyzer
Dec 5, 2025
5be60e5
[ContentUnderstanding] Fix Sample09 and remove incompatible Sample10-16
Dec 5, 2025
fc4a36b
Add Sample10_AnalyzeConfigs and Sample11_AnalyzeReturnRawJson
Dec 5, 2025
a101b28
Add Sample12_GetResultFile and Sample13_DeleteResult
Dec 5, 2025
cbdc2ad
Add Sample14_CopyAnalyzer, Sample15_GrantCopyAuth, and Sample16_Creat…
Dec 5, 2025
92711c7
Refactor Content Understanding Samples to Use Updated Environment Var…
Dec 5, 2025
984b4df
Update Content Understanding Samples to Use DefaultAzureCredential fo…
Dec 8, 2025
24a9ff7
Update analyzer copy endpoint to use simplified path and expand expec…
Dec 8, 2025
5fefcc3
Enhance verification steps in Sample14_CopyAnalyzer to ensure accurat…
Dec 9, 2025
651ce86
Refactor Content Understanding Samples to Support API Key and Default…
Dec 10, 2025
aad4f2e
Refactor Content Understanding Samples to Use Single Line for Client …
Dec 10, 2025
9dd7d8a
Add samples for content understanding SDK
Dec 11, 2025
fedf711
Update assets.json to include specific tag for content understanding SDK
Dec 12, 2025
dd8ebf3
Update sample file paths and add new sample documents for content und…
Dec 12, 2025
8467d24
Disable JaCoCo coverage and Checkstyle for beta.1 - tests under devel…
Dec 12, 2025
420cb89
Fix JaCoCo coverage values: use 0 instead of 0.00
Dec 12, 2025
e2af7aa
Add UPCA and UPCE barcode terms to spelling dictionary
Dec 12, 2025
451a119
Enable Record/Playback test mode for Sample tests
Dec 17, 2025
bea9203
Fix surefire include pattern to only match generated/Sample*.java
Dec 17, 2025
61fc2a3
Fix double-slash issue in test recordings for Content Understanding
Dec 17, 2025
7b55d95
Fix double-slash issue in test recordings: update assets.json to new …
Dec 17, 2025
760866c
Strip trailing slash from endpoint to prevent double-slash in URLs
Dec 17, 2025
12b2364
Merge branch 'main' of https://github.com/azure-sdk/azure-sdk-for-jav…
Jan 6, 2026
1c490eb
Customize Content Understanding Java SDK to match .NET SDK patterns
Jan 8, 2026
022040a
Update tests/samples to use convenience methods (getValue, getFieldOr…
Jan 8, 2026
2279e7f
Fix Sample03 InvoiceDate type casting - DateField returns LocalDate n…
Jan 8, 2026
1433066
Fix CopyAnalyzer API issues and add test recordings
Jan 8, 2026
9cf932e
Update README.md with comprehensive documentation
Jan 9, 2026
3e586c8
Add cspell.json with custom words for spell checking
Jan 9, 2026
316b6e9
Add azure-ai-contentunderstanding to version_client.txt
Jan 9, 2026
45f30f2
Add customization to fix copyAnalyzer API path
Jan 9, 2026
f9369bc
Remove incompatible generated samples and tests
Jan 9, 2026
7155b72
Stop hiding beginAnalyze methods to fix sample compilation
Jan 9, 2026
1ce5028
Use ClientLogger for exception throwing to fix checkstyle linting errors
Jan 9, 2026
50b979b
TEST: Add test resource creation files and also tests.yml for CI
yungshinlintw Jan 12, 2026
1512c2e
Address PR review feedback for azure-ai-contentunderstanding SDK
changjian-wang Jan 12, 2026
c10fdf5
Merge branch 'sdkauto/azure-ai-contentunderstanding-5634426' of https…
Jan 12, 2026
a171886
Add sample test for updating default configuration in Content Underst…
changjian-wang Jan 12, 2026
c26e48d
Update assets.json to match renamed Sample00_UpdateDefaults test
Jan 12, 2026
fd183d3
README: Fix incorrect reference
yungshinlintw Jan 12, 2026
99305b6
Address PR review comments: use environment variables for model deplo…
Jan 12, 2026
a313f62
Update README.md with model deployment environment variables
Jan 12, 2026
355133d
Fix CI linting errors: update convenience methods to return typed obj…
Jan 12, 2026
31790c3
Update test recordings for Sample00, Sample08, Sample14
Jan 12, 2026
9071184
Update Sample12 to use getResultFile convenience method instead of ge…
Jan 16, 2026
fc3c0c5
Update Sample15 to use grantCopyAuthorization convenience method inst…
Jan 16, 2026
3327a1a
Fix Step 3 comment to show correct beginCopyAnalyzer convenience meth…
Jan 16, 2026
a5b42b9
Address PR review comments and standardize environment variables
Jan 16, 2026
cbe3663
README: Update sample running instructions
yungshinlintw Jan 22, 2026
742d729
README: Update sample running instruction
yungshinlintw Jan 22, 2026
39e9e16
Refactor sample code to use environment variables for endpoint config…
yungshinlintw Jan 22, 2026
420e707
CI: Update pom.xml version
yungshinlintw Jan 22, 2026
13edc5e
SAMPLE: Update invoice sample
yungshinlintw Jan 22, 2026
7471695
CI: Fix cspell issue
yungshinlintw Jan 22, 2026
917ac66
README: Update sample instruction
yungshinlintw Jan 22, 2026
914bc3c
SAMPLE: Simplify CreateAnalyzer sample
yungshinlintw Jan 22, 2026
03eaccc
SAMPLE: Refactor analyzer creation in samples for improved readabilit…
yungshinlintw Jan 22, 2026
9d328fd
CI: UPdatecseppl.json for compiler instructions in README
yungshinlintw Jan 22, 2026
d5dafec
SAMPLE: Clean up messages
yungshinlintw Jan 23, 2026
83b1f65
SAMPLE/TEST: Generated unused generated tests
yungshinlintw Jan 23, 2026
b9f5c4a
SDK-GEN: Update with latest commit for TypeSpec to address copyAnalyz…
yungshinlintw Jan 23, 2026
c3c2dc7
TEST: Upload recording
yungshinlintw Jan 23, 2026
3e35e3b
SAMPLE: Update environment variable names in GrantCopyAuth sample for…
yungshinlintw Jan 23, 2026
0f2d991
SDK-CUSTOMIZATION: Introduce simplified beginAnalyze methods in Conte…
yungshinlintw Jan 23, 2026
432099a
TEST: Update recording in assets.json to reflect new tag version for …
yungshinlintw Jan 23, 2026
dd5891a
Refactor content understanding samples and tests for classifier creat…
Jan 23, 2026
c7b2771
Merge branch 'sdkauto/azure-ai-contentunderstanding-5634426' of https…
Jan 23, 2026
ff01c09
Refactor assertions in sample tests to use static imports for improve…
Jan 23, 2026
d6e4a08
Add async samples for deleting analysis results, copying analyzers, g…
Jan 23, 2026
1887270
Refactor sample tests to remove async suffix from method names and up…
wangchangjian1130 Jan 23, 2026
2be9c6c
Update classifier creation samples to include 'true' for enableSegmen…
wangchangjian1130 Jan 23, 2026
6d69aa2
Add retry mechanism for getResultFile in Sample12 tests and samples
wangchangjian1130 Jan 23, 2026
e8e24dc
Update asset tag in assets.json to reflect latest version
wangchangjian1130 Jan 23, 2026
d8f204f
Update assets.json tag and modify training data SAS URL handling in a…
wangchangjian1130 Jan 23, 2026
f459825
AGENT: Add agents for compiling CU SDK in place , run samples, and ru…
yungshinlintw Jan 26, 2026
d3bae81
SAMPLE: Update async sample to use reactive pattern. Add a create-cu-…
yungshinlintw Jan 26, 2026
b9385b6
SAMPLE: Fix CI issue
yungshinlintw Jan 27, 2026
7f006a6
SAMPLE: Fix CI issue in skill md file
yungshinlintw Jan 27, 2026
4e96ff4
Refactor samples to use reactive pattern for polling results
Jan 27, 2026
7c331a6
Update assets.json with new session recordings tag
Jan 27, 2026
aef157d
Update assets.json with Sample16 labeled training data recordings
Jan 27, 2026
cf0f7e2
Add SDK skills for recording and playback testing
Jan 27, 2026
eb41383
Add SDK skills for recording and playback testing
Jan 27, 2026
4e2285f
Refactor README and SKILL.md files to streamline content and remove o…
Jan 27, 2026
7d9e2a0
SAMPLE: Update Sample 02 to run video/audio/image too
yungshinlintw Jan 27, 2026
0cf7bf3
SKILL: Add sample quality review skill
yungshinlintw Jan 27, 2026
6b4d455
CI: Fix CI issues
yungshinlintw Jan 27, 2026
6879383
CUSTOMIZATION: Update TypeSpec commit id and generate beginAnalyze[B…
yungshinlintw Jan 30, 2026
b2e11c0
Merge branch 'main' into sdkauto/azure-ai-contentunderstanding-5634426
yungshinlintw Jan 30, 2026
d6968ee
Add assertions and BEGIN/END markers to Sample00_UpdateDefaults tests
Jan 30, 2026
7a4ed28
Merge branch 'sdkauto/azure-ai-contentunderstanding-5634426' of https…
Jan 30, 2026
5a361b1
Update test recordings for Sample tests
Jan 30, 2026
f29e243
Update README.md to include full URLs for skills documentation
wangchangjian1130 Jan 30, 2026
a2ab500
CI: Fix cusotmization code that throw exception directly, instead of …
yungshinlintw Jan 30, 2026
8eac9ef
CI: Fix javadoc issue
yungshinlintw Jan 30, 2026
ceb3470
Merge branch 'main' into sdkauto/azure-ai-contentunderstanding-5634426
yungshinlintw Jan 30, 2026
08123ac
Update assets.json with new tag version and enhance error handling in…
yungshinlintw Jan 31, 2026
31e5dc1
Merge branch 'sdkauto/azure-ai-contentunderstanding-5634426' of https…
yungshinlintw Jan 31, 2026
9869a93
Updapte sample 16 and its tests. Push recording with updated tests
yungshinlintw Jan 31, 2026
6deb8be
CI: Remove customization not required
yungshinlintw Feb 1, 2026
c125bcb
AGENT SKILL: Remove skills for better refacotring later
yungshinlintw Feb 2, 2026
9965b0b
CUSTOMIZATION: Updates comments
yungshinlintw Feb 2, 2026
7ea8d6c
POM: Update package name and description
yungshinlintw Feb 2, 2026
744766d
Merge branch 'main' into sdkauto/azure-ai-contentunderstanding-5634426
chienyuanchang Feb 4, 2026
9ba4a9e
CUSTOMIZATION: Improve ContentField access methods and update conveni…
yungshinlintw Feb 5, 2026
95a5b8b
CUSTOMIZATION: Make the hidding of analyze/analyzeBinary to be robust
yungshinlintw Feb 5, 2026
df30ffa
Merge branch 'sdkauto/azure-ai-contentunderstanding-5634426' of https…
yungshinlintw Feb 5, 2026
a1a9973
README: Update pom.xml to remove test scope for azure-identity depend…
yungshinlintw Feb 5, 2026
f8666be
Merge branch 'main' into sdkauto/azure-ai-contentunderstanding-5634426
yungshinlintw Feb 5, 2026
db126ac
Merge branch 'main' into sdkauto/azure-ai-contentunderstanding-5634426
yungshinlintw Feb 5, 2026
a472f8c
TEST: Refactor sample file paths in tests to new directory structure …
yungshinlintw Feb 6, 2026
4be21d4
Merge branch 'sdkauto/azure-ai-contentunderstanding-5634426' of https…
yungshinlintw Feb 6, 2026
dba5fe3
[ContentUnderstanding] Update SDK to latest TypeSpec commit
Feb 10, 2026
0055783
[ContentUnderstanding] Update SDK to latest TypeSpec commit (ff47dc5)
Feb 10, 2026
1000cee
Fix README formatting: add missing blank line before section heading
Feb 10, 2026
5bd2fc1
Merge remote-tracking branch 'origin/main' into cu_sdk/ga
Feb 10, 2026
bcb0aca
Regenerate SDK with emitter 0.39.1 after merging main
Feb 10, 2026
8578386
Fix polling context key mismatches and metadata issues in azure-ai-co…
Copilot Feb 10, 2026
38a95e6
Merge branch 'main' into cu_sdk/ga
changjian-wang Feb 10, 2026
3c31037
Merge branch 'main' into cu_sdk/ga
changjian-wang Feb 10, 2026
b0050eb
Fix polling strategy key consistency, error formatting, and async sam…
Copilot Feb 10, 2026
950c643
Fix customization to produce correct polling strategy code
Feb 10, 2026
a33390e
Update sdk/contentunderstanding/azure-ai-contentunderstanding/pom.xml
changjian-wang Feb 10, 2026
656d581
Update sdk/contentunderstanding/azure-ai-contentunderstanding/src/mai…
changjian-wang Feb 10, 2026
f14a45a
Update sdk/contentunderstanding/azure-ai-contentunderstanding/src/mai…
changjian-wang Feb 10, 2026
6e6ba02
Fix typos in DocumentParagraph and initialize kind in KnowledgeSource
wangchangjian1130 Feb 10, 2026
a627f43
Refactor sample applications to use CountDownLatch for async operatio…
wangchangjian1130 Feb 10, 2026
656b892
Update sdk/contentunderstanding/azure-ai-contentunderstanding/src/sam…
yungshinlintw Feb 10, 2026
73cf1eb
Update sdk/contentunderstanding/azure-ai-contentunderstanding/src/sam…
yungshinlintw Feb 10, 2026
fbab37e
Update version to 1.0.0 and finalize release notes for Azure Content …
Feb 11, 2026
3413eb8
Remove System.exit(1) from async samples (#47966)
Copilot Feb 11, 2026
e10f302
Update CODEOWNERS to add additional owners for Content Understanding …
Feb 11, 2026
be2f3b6
Remove no-op fixGeneratedAnalyzeBodiesToCallImplWithUtf16 customization
Feb 11, 2026
c381b36
Remove fixGeneratedPollingStrategyCode method and related calls
wangchangjian1130 Feb 11, 2026
52f3fb1
Fix generated polling strategy code for case sensitivity and error me…
wangchangjian1130 Feb 11, 2026
abc9e93
Add receipt2 image and associated label and result files; update anal…
Feb 13, 2026
afef6f7
Update asset tags and improve sample documentation for training data …
Feb 14, 2026
73cac91
Merge branches 'cu_sdk/ga-sample16-labels' and 'main' of https://gith…
Mar 4, 2026
add9142
Merge remote-tracking branch 'origin/main' into cu_sdk/ga-sample16-la…
Mar 4, 2026
dffc437
Refactor content understanding sample tests to use AnalysisResult and…
Mar 4, 2026
0f712de
Add sample for creating an analyzer with labels asynchronously
Mar 5, 2026
9b4aa45
Merge branch 'main' into cu_sdk/ga-sample16-labels
changjian-wang Apr 3, 2026
80ce167
Merge branch 'main' into cu_sdk/ga-sample16-labels
changjian-wang Apr 3, 2026
6fc914a
Merge branch 'main' into cu_sdk/ga-sample16-labels
changjian-wang Apr 9, 2026
44af11b
Merge branch 'main' into cu_sdk/ga-sample16-labels
changjian-wang Apr 10, 2026
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 @@ -68,6 +68,12 @@
<artifactId>azure-identity</artifactId>
<version>1.18.2</version> <!-- {x-version-update;com.azure:azure-identity;dependency} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-blob</artifactId>
<version>12.33.2</version> <!-- {x-version-update;com.azure:azure-storage-blob;dependency} -->
<scope>test</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.azure.ai.contentunderstanding.implementation;

import com.azure.ai.contentunderstanding.models.ContentAnalyzerAnalyzeOperationStatus;

/**
* Helper class to access private members of ContentAnalyzerAnalyzeOperationStatus.
*/
public final class ContentAnalyzerAnalyzeOperationStatusHelper {
private static ContentAnalyzerAnalyzeOperationStatusAccessor accessor;

/**
* Interface for accessing private members.
*/
public interface ContentAnalyzerAnalyzeOperationStatusAccessor {
void setOperationId(ContentAnalyzerAnalyzeOperationStatus status, String operationId);
}

/**
* Sets the accessor.
*
* @param accessorInstance the accessor instance.
*/
public static void setAccessor(ContentAnalyzerAnalyzeOperationStatusAccessor accessorInstance) {
accessor = accessorInstance;
}

/**
* Sets the operationId on a ContentAnalyzerAnalyzeOperationStatus instance.
*
* @param status the status instance.
* @param operationId the operationId to set.
*/
public static void setOperationId(ContentAnalyzerAnalyzeOperationStatus status, String operationId) {
accessor.setOperationId(status, operationId);
Comment on lines +34 to +36

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setOperationId will throw a NullPointerException if setAccessor(...) was never called (or is called later), since accessor is not validated.
Add a guard that throws a clear IllegalStateException when the accessor is not initialized, or initialize the accessor from ContentAnalyzerAnalyzeOperationStatus static initialization to ensure it is always set before use.

Suggested change
*/
public static void setOperationId(ContentAnalyzerAnalyzeOperationStatus status, String operationId) {
accessor.setOperationId(status, operationId);
* @throws IllegalStateException if the accessor has not been initialized.
*/
public static void setOperationId(ContentAnalyzerAnalyzeOperationStatus status, String operationId) {
ContentAnalyzerAnalyzeOperationStatusAccessor currentAccessor = accessor;
if (currentAccessor == null) {
throw new IllegalStateException("ContentAnalyzerAnalyzeOperationStatus accessor has not been "
+ "initialized. Ensure setAccessor(...) is called before setOperationId(...).");
}
currentAccessor.setOperationId(status, operationId);

Copilot uses AI. Check for mistakes.
}

private ContentAnalyzerAnalyzeOperationStatusHelper() {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.
package com.azure.ai.contentunderstanding.models;

import com.azure.core.annotation.Generated;
import com.azure.core.annotation.Immutable;
import com.azure.core.util.logging.ClientLogger;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
import java.util.List;

/**
* Array field extracted from the content.
*/
@Immutable
public final class ArrayField extends ContentField {

/*
* Semantic data type of the field value.
*/
@Generated
private ContentFieldType type = ContentFieldType.ARRAY;

/*
* Array field value.
*/
@Generated
private List<ContentField> valueArray;

/**
* Creates an instance of ArrayField class.
*/
@Generated
private ArrayField() {
}

/**
* Get the type property: Semantic data type of the field value.
*
* @return the type value.
*/
@Generated
@Override
public ContentFieldType getType() {
return this.type;
}

/**
* Get the valueArray property: Array field value.
*
* @return the valueArray value.
*/
@Generated
public List<ContentField> getValueArray() {
return this.valueArray;
}

/**
* {@inheritDoc}
*/
@Generated
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeArrayField("spans", getSpans(), (writer, element) -> writer.writeJson(element));
jsonWriter.writeNumberField("confidence", getConfidence());
jsonWriter.writeStringField("source", getSource());
jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString());
jsonWriter.writeArrayField("valueArray", this.valueArray, (writer, element) -> writer.writeJson(element));
return jsonWriter.writeEndObject();
}

/**
* Reads an instance of ArrayField from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of ArrayField if the JsonReader was pointing to an instance of it, or null if it was pointing
* to JSON null.
* @throws IOException If an error occurs while reading the ArrayField.
*/
@Generated
public static ArrayField fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
ArrayField deserializedArrayField = new ArrayField();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("spans".equals(fieldName)) {
List<ContentSpan> spans = reader.readArray(reader1 -> ContentSpan.fromJson(reader1));
deserializedArrayField.setSpans(spans);
} else if ("confidence".equals(fieldName)) {
deserializedArrayField.setConfidence(reader.getNullable(JsonReader::getDouble));
} else if ("source".equals(fieldName)) {
deserializedArrayField.setSource(reader.getString());
} else if ("type".equals(fieldName)) {
deserializedArrayField.type = ContentFieldType.fromString(reader.getString());
} else if ("valueArray".equals(fieldName)) {
List<ContentField> valueArray = reader.readArray(reader1 -> ContentField.fromJson(reader1));
deserializedArrayField.valueArray = valueArray;
} else {
reader.skipChildren();
}
}
return deserializedArrayField;
});
}

private static final ClientLogger LOGGER = new ClientLogger(ArrayField.class);

/**
* Gets the number of items in the array.
*
* @return the number of items in the array, or 0 if the array is null.
*/
public int size() {
return getValueArray() != null ? getValueArray().size() : 0;
}

/**
* Gets a field from the array by index.
*
* @param index The zero-based index of the field to retrieve.
* @return The field at the specified index.
* @throws IndexOutOfBoundsException if the index is out of range.
*/
public ContentField get(int index) {
if (getValueArray() == null || index < 0 || index >= getValueArray().size()) {
throw LOGGER.logThrowableAsError(new IndexOutOfBoundsException(
"Index " + index + " is out of range. Array has " + size() + " elements."));
}
return getValueArray().get(index);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.

package com.azure.ai.contentunderstanding.models;

import com.azure.core.annotation.Generated;
import com.azure.core.annotation.Immutable;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
import java.util.List;

/**
* Boolean field extracted from the content.
*/
@Immutable
public final class BooleanField extends ContentField {
/*
* Semantic data type of the field value.
*/
@Generated
private ContentFieldType type = ContentFieldType.BOOLEAN;

/*
* Boolean field value.
*/
@Generated
private Boolean valueBoolean;

/**
* Creates an instance of BooleanField class.
*/
@Generated
private BooleanField() {
}

/**
* Get the type property: Semantic data type of the field value.
*
* @return the type value.
*/
@Generated
@Override
public ContentFieldType getType() {
return this.type;
}

/**
* Get the valueBoolean property: Boolean field value.
*
* @return the valueBoolean value.
*/
@Generated
public Boolean isValueBoolean() {
return this.valueBoolean;
}

/**
* {@inheritDoc}
*/
@Generated
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeArrayField("spans", getSpans(), (writer, element) -> writer.writeJson(element));
jsonWriter.writeNumberField("confidence", getConfidence());
jsonWriter.writeStringField("source", getSource());
jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString());
jsonWriter.writeBooleanField("valueBoolean", this.valueBoolean);
return jsonWriter.writeEndObject();
}

/**
* Reads an instance of BooleanField from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of BooleanField if the JsonReader was pointing to an instance of it, or null if it was
* pointing to JSON null.
* @throws IOException If an error occurs while reading the BooleanField.
*/
@Generated
public static BooleanField fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
BooleanField deserializedBooleanField = new BooleanField();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();

if ("spans".equals(fieldName)) {
List<ContentSpan> spans = reader.readArray(reader1 -> ContentSpan.fromJson(reader1));
deserializedBooleanField.setSpans(spans);
} else if ("confidence".equals(fieldName)) {
deserializedBooleanField.setConfidence(reader.getNullable(JsonReader::getDouble));
} else if ("source".equals(fieldName)) {
deserializedBooleanField.setSource(reader.getString());
} else if ("type".equals(fieldName)) {
deserializedBooleanField.type = ContentFieldType.fromString(reader.getString());
} else if ("valueBoolean".equals(fieldName)) {
deserializedBooleanField.valueBoolean = reader.getNullable(JsonReader::getBoolean);
} else {
reader.skipChildren();
}
}

return deserializedBooleanField;
});
}
}
Loading
Loading