Partager via


StringKeyValuePair Class

  • java.lang.Object
    • com.azure.resourcemanager.networkcloud.models.StringKeyValuePair

Implements

public final class StringKeyValuePair
implements JsonSerializable<StringKeyValuePair>

StringKeyValuePair represents a single entry in a mapping of keys to values.

Constructor Summary

Constructor Description
StringKeyValuePair()

Creates an instance of StringKeyValuePair class.

Method Summary

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

Reads an instance of StringKeyValuePair from the JsonReader.

String key()

Get the key property: The key to the mapped value.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

String value()

Get the value property: The value of the mapping key.

StringKeyValuePair withKey(String key)

Set the key property: The key to the mapped value.

StringKeyValuePair withValue(String value)

Set the value property: The value of the mapping key.

Methods inherited from java.lang.Object

Constructor Details

StringKeyValuePair

public StringKeyValuePair()

Creates an instance of StringKeyValuePair class.

Method Details

fromJson

public static StringKeyValuePair fromJson(JsonReader jsonReader)

Reads an instance of StringKeyValuePair from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

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

key

public String key()

Get the key property: The key to the mapped value.

Returns:

the key value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

value

public String value()

Get the value property: The value of the mapping key.

Returns:

the value value.

withKey

public StringKeyValuePair withKey(String key)

Set the key property: The key to the mapped value.

Parameters:

key - the key value to set.

Returns:

the StringKeyValuePair object itself.

withValue

public StringKeyValuePair withValue(String value)

Set the value property: The value of the mapping key.

Parameters:

value - the value value to set.

Returns:

the StringKeyValuePair object itself.

Applies to