KeyValuePair Class

  • java.lang.Object
    • com.azure.resourcemanager.chaos.models.KeyValuePair

Implements

public final class KeyValuePair
implements JsonSerializable<KeyValuePair>

A map to describe the settings of an action.

Constructor Summary

Constructor Description
KeyValuePair()

Creates an instance of KeyValuePair class.

Method Summary

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

Reads an instance of KeyValuePair from the JsonReader.

String key()

Get the key property: The name of the setting for the action.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

String value()

Get the value property: The value of the setting for the action.

KeyValuePair withKey(String key)

Set the key property: The name of the setting for the action.

KeyValuePair withValue(String value)

Set the value property: The value of the setting for the action.

Methods inherited from java.lang.Object

Constructor Details

KeyValuePair

public KeyValuePair()

Creates an instance of KeyValuePair class.

Method Details

fromJson

public static KeyValuePair fromJson(JsonReader jsonReader)

Reads an instance of KeyValuePair from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of KeyValuePair 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 name of the setting for the action.

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 setting for the action.

Returns:

the value value.

withKey

public KeyValuePair withKey(String key)

Set the key property: The name of the setting for the action.

Parameters:

key - the key value to set.

Returns:

the KeyValuePair object itself.

withValue

public KeyValuePair withValue(String value)

Set the value property: The value of the setting for the action.

Parameters:

value - the value value to set.

Returns:

the KeyValuePair object itself.

Applies to