Share via


ContentSpan Class

  • java.lang.Object
    • com.azure.ai.contentunderstanding.models.ContentSpan

Implements

public final class ContentSpan
implements JsonSerializable<ContentSpan>

Position of the element in markdown, specified as a character offset and length.

Method Summary

Modifier and Type Method and Description
static ContentSpan fromJson(JsonReader jsonReader)

Reads an instance of ContentSpan from the JsonReader.

int getLength()

Get the length property: Length of the element in markdown, specified in characters.

int getOffset()

Get the offset property: Starting position (0-indexed) of the element in markdown, specified in characters.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Method Details

fromJson

public static ContentSpan fromJson(JsonReader jsonReader)

Reads an instance of ContentSpan from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of ContentSpan if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

getLength

public int getLength()

Get the length property: Length of the element in markdown, specified in characters.

Returns:

the length value.

getOffset

public int getOffset()

Get the offset property: Starting position (0-indexed) of the element in markdown, specified in characters.

Returns:

the offset value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to