Compartilhar via


ConfigurationSetting Class

  • java.lang.Object
    • com.azure.data.appconfiguration.models.ConfigurationSetting

Implements

public class ConfigurationSetting
implements JsonSerializable<ConfigurationSetting>

ConfigurationSetting is a resource identified by unique combination of getKey() and getLabel(). By default, the label is null. To explicitly reference the default label use NO_LABEL.

Field Summary

Modifier and Type Field and Description
static final String NO_LABEL

The default label for configuration settings is the label, "\0".

Constructor Summary

Constructor Description
ConfigurationSetting()

Creates an instance of the configuration setting.

Method Summary

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

Reads an instance of ConfigurationSetting from the JsonReader.

String getContentType()

Gets the content type of this configuration setting.

String getETag()

The ETag for this configuration setting.

String getKey()

Gets the key name for this configuration setting.

String getLabel()

Gets the label of this configuration setting.

OffsetDateTime getLastModified()

The time when the configuration setting was last modified.

Map<String,String> getTags()

Gets tags associated with this configuration setting.

String getValue()

Gets the value of this configuration setting.

boolean isReadOnly()

Gets whether or not the configuration setting is read-only.

ConfigurationSetting setContentType(String contentType)

Sets the content type.

ConfigurationSetting setETag(String etag)

Sets the ETag for this configuration setting.

ConfigurationSetting setKey(String key)

Sets the key of this configuration setting.

ConfigurationSetting setLabel(String label)

Sets the label of this configuration setting.

ConfigurationSetting setTags(Map<String,String> tags)

Sets the tags for this configuration setting.

ConfigurationSetting setValue(String value)

Sets the value of this setting.

JsonWriter toJson(JsonWriter jsonWriter)
String toString()

Methods inherited from java.lang.Object

Field Details

NO_LABEL

public static final String NO_LABEL

The default label for configuration settings is the label, "\0". Users use this value when they want to explicitly reference a configuration setting that has no label. This gets URL encoded as "%00".

Constructor Details

ConfigurationSetting

public ConfigurationSetting()

Creates an instance of the configuration setting.

Method Details

fromJson

public static ConfigurationSetting fromJson(JsonReader jsonReader)

Reads an instance of ConfigurationSetting from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

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

getContentType

public String getContentType()

Gets the content type of this configuration setting. By default, this content type is null.

Returns:

The content type of this setting.

getETag

public String getETag()

The ETag for this configuration setting.

Returns:

etag The ETag for the setting.

getKey

public String getKey()

Gets the key name for this configuration setting.

Returns:

The key for this configuration setting.

getLabel

public String getLabel()

Gets the label of this configuration setting.

Returns:

The label of this setting.

getLastModified

public OffsetDateTime getLastModified()

The time when the configuration setting was last modified.

Returns:

The time when the configuration was last modified.

getTags

public Map getTags()

Gets tags associated with this configuration setting.

Returns:

tags Gets tags for this configuration setting.

getValue

public String getValue()

Gets the value of this configuration setting.

Returns:

The value of this configuration setting.

isReadOnly

public boolean isReadOnly()

Gets whether or not the configuration setting is read-only. If it is, then no modifications can be made to this setting. This is a readonly property. It is populated from responses from the Azure App Configuration service.

Returns:

true if read-only; false otherwise.

setContentType

public ConfigurationSetting setContentType(String contentType)

Sets the content type. By default, the content type is null.

Parameters:

contentType - The content type of this configuration setting.

Returns:

The updated ConfigurationSetting object.

setETag

public ConfigurationSetting setETag(String etag)

Sets the ETag for this configuration setting.

Parameters:

etag - The ETag for the configuration setting.

Returns:

The updated ConfigurationSetting object.

setKey

public ConfigurationSetting setKey(String key)

Sets the key of this configuration setting.

Parameters:

key - The name of the configuration key.

Returns:

ConfigurationSetting object itself.

setLabel

public ConfigurationSetting setLabel(String label)

Sets the label of this configuration setting. NO_LABEL is the default label used when this value is not set.

Parameters:

label - The label of this configuration setting.

Returns:

The updated ConfigurationSetting object.

setTags

public ConfigurationSetting setTags(Map tags)

Sets the tags for this configuration setting.

Parameters:

tags - The tags to add to this configuration setting.

Returns:

The updated ConfigurationSetting object.

setValue

public ConfigurationSetting setValue(String value)

Sets the value of this setting.

Parameters:

value - The value to associate with this configuration setting.

Returns:

The updated ConfigurationSetting object.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

toString

public String toString()

Overrides:

ConfigurationSetting.toString()

Applies to