Freigeben über


ContentObjectField Class

public final class ContentObjectField
extends ContentField

Object field extracted from the content.

Method Summary

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

Reads an instance of ContentObjectField from the JsonReader.

ContentField getField(String fieldName)

Gets a field from the object by name.

ContentField getFieldOrDefault(String fieldName)

Gets a field from the object by name, or null if the field does not exist.

ContentFieldType getType()

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

Map<String,ContentField> getValue()

Gets the strongly-typed value of this field.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from ContentField

Methods inherited from java.lang.Object

Method Details

fromJson

public static ContentObjectField fromJson(JsonReader jsonReader)

Reads an instance of ContentObjectField from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

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

getField

public ContentField getField(String fieldName)

Gets a field from the object by name.

Parameters:

fieldName - The name of the field to retrieve.

Returns:

The field if found.

getFieldOrDefault

public ContentField getFieldOrDefault(String fieldName)

Gets a field from the object by name, or null if the field does not exist.

Parameters:

fieldName - The name of the field to retrieve.

Returns:

The field if found, or null if not found.

getType

public ContentFieldType getType()

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

Overrides:

ContentObjectField.getType()

Returns:

the type value.

getValue

public Map<String,ContentField> getValue()

Gets the strongly-typed value of this field.

Overrides:

ContentObjectField.getValue()

Returns:

the field value, or null if not available.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Overrides:

ContentObjectField.toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to