Freigeben über


ContentArrayField Class

public final class ContentArrayField
extends ContentField

Array field extracted from the content.

Method Summary

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

Reads an instance of ContentArrayField from the JsonReader.

ContentField get(int index)

Gets a field from the array by index.

ContentFieldType getType()

Get the type property: Semantic data type of the field value.

List<ContentField> getValue()

Gets the strongly-typed value of this field.

int size()

Gets the number of items in the array.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from ContentField

Methods inherited from java.lang.Object

Method Details

fromJson

public static ContentArrayField fromJson(JsonReader jsonReader)

Reads an instance of ContentArrayField from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of ContentArrayField 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 ContentArrayField.

get

public ContentField get(int index)

Gets a field from the array by index.

Parameters:

index - The zero-based index of the field to retrieve.

Returns:

The field at the specified index.

getType

public ContentFieldType getType()

Get the type property: Semantic data type of the field value.

Overrides:

ContentArrayField.getType()

Returns:

the type value.

getValue

public List<ContentField> getValue()

Gets the strongly-typed value of this field.

Overrides:

ContentArrayField.getValue()

Returns:

the field value, or null if not available.

size

public int size()

Gets the number of items in the array.

Returns:

the number of items in the array, or 0 if the array is null.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Overrides:

ContentArrayField.toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to