你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

JsonFieldWithDefault Class

  • java.lang.Object
    • com.microsoft.azure.management.eventgrid.v2020_04_01_preview.JsonFieldWithDefault

public class JsonFieldWithDefault

This is used to express the source of an input schema mapping for a single target field in the Event Grid Event schema. This is currently used in the mappings for the 'subject', 'eventtype' and 'dataversion' properties. This represents a field in the input event schema along with a default value to be used, and at least one of these two properties should be provided.

Constructor Summary

Constructor Description
JsonFieldWithDefault()

Method Summary

Modifier and Type Method and Description
java.lang.String defaultValue()

Get the default value to be used for mapping when a SourceField is not provided or if there's no property with the specified name in the published JSON event payload.

java.lang.String sourceField()

Get name of a field in the input event schema that's to be used as the source of a mapping.

JsonFieldWithDefault withDefaultValue(String defaultValue)

Set the default value to be used for mapping when a SourceField is not provided or if there's no property with the specified name in the published JSON event payload.

JsonFieldWithDefault withSourceField(String sourceField)

Set name of a field in the input event schema that's to be used as the source of a mapping.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

JsonFieldWithDefault

public JsonFieldWithDefault()

Method Details

defaultValue

public String defaultValue()

Get the default value to be used for mapping when a SourceField is not provided or if there's no property with the specified name in the published JSON event payload.

Returns:

the defaultValue value

sourceField

public String sourceField()

Get name of a field in the input event schema that's to be used as the source of a mapping.

Returns:

the sourceField value

withDefaultValue

public JsonFieldWithDefault withDefaultValue(String defaultValue)

Set the default value to be used for mapping when a SourceField is not provided or if there's no property with the specified name in the published JSON event payload.

Parameters:

defaultValue - the defaultValue value to set

Returns:

the JsonFieldWithDefault object itself.

withSourceField

public JsonFieldWithDefault withSourceField(String sourceField)

Set name of a field in the input event schema that's to be used as the source of a mapping.

Parameters:

sourceField - the sourceField value to set

Returns:

the JsonFieldWithDefault object itself.

Applies to