SubResourceModel Class

public class SubResourceModel
extends SubResource

Reference to another subresource.

Constructor Summary

Constructor Description
SubResourceModel()

Creates an instance of SubResourceModel class.

Method Summary

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

Reads an instance of SubResourceModel from the JsonReader.

String name()

Get the name property: Name of the resource.

JsonWriter toJson(JsonWriter jsonWriter)
String type()

Get the type property: Resource type.

void validate()

Validates the instance.

SubResourceModel withId(String id)
SubResourceModel withName(String name)

Set the name property: Name of the resource.

Methods inherited from SubResource

Methods inherited from java.lang.Object

Constructor Details

SubResourceModel

public SubResourceModel()

Creates an instance of SubResourceModel class.

Method Details

fromJson

public static SubResourceModel fromJson(JsonReader jsonReader)

Reads an instance of SubResourceModel from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

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

name

public String name()

Get the name property: Name of the resource.

Returns:

the name value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Overrides:

SubResourceModel.toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

type

public String type()

Get the type property: Resource type.

Returns:

the type value.

validate

public void validate()

Validates the instance.

withId

public SubResourceModel withId(String id)

Overrides:

SubResourceModel.withId(String id)

Parameters:

id

withName

public SubResourceModel withName(String name)

Set the name property: Name of the resource.

Parameters:

name - the name value to set.

Returns:

the SubResourceModel object itself.

Applies to