Package org.apache.beam.sdk.util
Enum RowJson.RowJsonDeserializer.NullBehavior
- java.lang.Object
-
- java.lang.Enum<RowJson.RowJsonDeserializer.NullBehavior>
-
- org.apache.beam.sdk.util.RowJson.RowJsonDeserializer.NullBehavior
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<RowJson.RowJsonDeserializer.NullBehavior>
- Enclosing class:
- RowJson.RowJsonDeserializer
public static enum RowJson.RowJsonDeserializer.NullBehavior extends java.lang.Enum<RowJson.RowJsonDeserializer.NullBehavior>
An enumeration type for specifying howRowJson.RowJsonDeserializer
should expect null values to be represented.For example, when parsing JSON for the Schema
(str: REQUIRED STRING, int: NULLABLE INT64)
:- If configured with
REQUIRE_NULL
,{"str": "foo", "int": null}
would be accepted. - If configured with
REQUIRE_MISSING
,{"str": "bar"}
would be accepted, and would yield aRow
withnull
for theint
field. - If configured with
ALLOW_MISSING_OR_NULL
, either JSON string would be accepted.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ACCEPT_MISSING_OR_NULL
Specifies that a null value may be represented as either a missing field or a null value in the input JSON.REQUIRE_MISSING
Specifies that a null value must be represented with a missing field in JSON.REQUIRE_NULL
Specifies that a null value must be represented with a null value in JSON.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RowJson.RowJsonDeserializer.NullBehavior
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static RowJson.RowJsonDeserializer.NullBehavior[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ACCEPT_MISSING_OR_NULL
public static final RowJson.RowJsonDeserializer.NullBehavior ACCEPT_MISSING_OR_NULL
Specifies that a null value may be represented as either a missing field or a null value in the input JSON.
-
REQUIRE_NULL
public static final RowJson.RowJsonDeserializer.NullBehavior REQUIRE_NULL
Specifies that a null value must be represented with a null value in JSON. If the field is missing anRowJson.UnsupportedRowJsonException
will be thrown.
-
REQUIRE_MISSING
public static final RowJson.RowJsonDeserializer.NullBehavior REQUIRE_MISSING
Specifies that a null value must be represented with a missing field in JSON. If the field has a null value anRowJson.UnsupportedRowJsonException
will be thrown.
-
-
Method Detail
-
values
public static RowJson.RowJsonDeserializer.NullBehavior[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (RowJson.RowJsonDeserializer.NullBehavior c : RowJson.RowJsonDeserializer.NullBehavior.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static RowJson.RowJsonDeserializer.NullBehavior valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
-